Skip to content

Commit

Permalink
-update all scopes
Browse files Browse the repository at this point in the history
-remove duplicated code
  • Loading branch information
David Kutugata committed Sep 15, 2021
1 parent e0619ea commit af79fd4
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/client/datascience/jupyter/debuggerVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,22 +453,10 @@ export class DebuggerVariables extends DebugLocationTracker

// Call variables
if (scopesResponse) {
// Keep track of variablesReference because "hover" requests also try to update variables
const newVariablesReference = scopesResponse.scopes[0].variablesReference;
if (newVariablesReference !== this.currentVariablesReference) {
this.currentVariablesReference = newVariablesReference;
this.currentSeqNumsForVariables.clear();
}

// Catch the scopes response and use its variablesReference to send a variables message
const varResponse: DebugProtocol.VariablesResponse = await session.customRequest('variables', {
variablesReference: newVariablesReference
scopesResponse.scopes.forEach((scope: DebugProtocol.Scope) => {
void session.customRequest('variables', { variablesReference: scope.variablesReference });
});

// Refresh variable view
this.updateVariables(undefined, varResponse as DebugProtocol.VariablesResponse);
this.monkeyPatchDataViewableVariables(varResponse);

this.refreshEventEmitter.fire();
}
}
Expand Down

0 comments on commit af79fd4

Please sign in to comment.