File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,11 @@ export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWa
6969 const onDidChangeActiveDebugSession = tracker . onDidChangeActiveDebugSession ( async ( session ) => await this . handleOnDidChangeActiveDebugSession ( session ) ) ;
7070 const onWillStartSession = tracker . onWillStartSession ( async ( session ) => await this . handleOnWillStartSession ( session ) ) ;
7171 // Doing a refresh on pausing to ensure we have the latest data
72- const onStopped = tracker . onStopped ( async ( ) => await this . refresh ( ) ) ;
72+ const onStopped = tracker . onStopped ( async ( event ) => {
73+ if ( this . _activeSession ?. session . id === event . session . session . id ) {
74+ await this . refresh ( ) ;
75+ }
76+ } ) ;
7377 // Using this event because this is when the threadId is available for evaluations
7478 const onStackTrace = tracker . onDidChangeActiveStackItem ( async ( ) => await this . refresh ( ) ) ;
7579 // Clearing active session on closing the session
@@ -97,14 +101,16 @@ export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWa
97101 }
98102
99103 private async handleOnDidChangeActiveDebugSession ( session : GDBTargetDebugSession | undefined ) : Promise < void > {
100- this . _activeSession = session ;
101- await this . refresh ( ) ;
104+ if ( this . _activeSession ?. session . id === session ?. session . id ) {
105+ await this . refresh ( ) ;
106+ }
102107 }
103108
104109 private async handleOnWillStartSession ( session : GDBTargetDebugSession ) : Promise < void > {
105110 session . refreshTimer . onRefresh ( async ( refreshSession ) => {
106- this . _activeSession = refreshSession ;
107- await this . refresh ( ) ;
111+ if ( this . _activeSession ?. session . id === refreshSession . session . id ) {
112+ await this . refresh ( ) ;
113+ }
108114 } ) ;
109115 }
110116
You can’t perform that action at this time.
0 commit comments