File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/debug/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,10 +17,11 @@ export class DebugProgressContribution implements IWorkbenchContribution {
1717 @IDebugService private readonly debugService : IDebugService ,
1818 @IProgressService private readonly progressService : IProgressService
1919 ) {
20- let progressListener : IDisposable ;
21- const onFocusSession = ( session : IDebugSession | undefined ) => {
20+ let progressListener : IDisposable | undefined ;
21+ const listenOnProgress = ( session : IDebugSession | undefined ) => {
2222 if ( progressListener ) {
2323 progressListener . dispose ( ) ;
24+ progressListener = undefined ;
2425 }
2526 if ( session ) {
2627 progressListener = session . onDidProgressStart ( async progressStartEvent => {
@@ -71,8 +72,13 @@ export class DebugProgressContribution implements IWorkbenchContribution {
7172 } ) ;
7273 }
7374 } ;
74- this . toDispose . push ( this . debugService . getViewModel ( ) . onDidFocusSession ( onFocusSession ) ) ;
75- onFocusSession ( this . debugService . getViewModel ( ) . focusedSession ) ;
75+ this . toDispose . push ( this . debugService . getViewModel ( ) . onDidFocusSession ( listenOnProgress ) ) ;
76+ listenOnProgress ( this . debugService . getViewModel ( ) . focusedSession ) ;
77+ this . toDispose . push ( this . debugService . onWillNewSession ( session => {
78+ if ( ! progressListener ) {
79+ listenOnProgress ( session ) ;
80+ }
81+ } ) ) ;
7682 }
7783
7884 dispose ( ) : void {
You can’t perform that action at this time.
0 commit comments