Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid unnecessary scopes and variables calls #7313

Merged
merged 5 commits into from
Aug 27, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/client/debugger/jupyter/kernelDebugAdapter.ts
Original file line number Diff line number Diff line change
@@ -377,7 +377,11 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
// Here we catch the stackTrace response and we use its id to send a scope message
if ((message as DebugProtocol.StackTraceResponse).command === 'stackTrace') {
(message as DebugProtocol.StackTraceResponse).body.stackFrames.forEach((sf) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could even be optimized more - this will send the request for the cell's frame even if it is not the first frame in the stack, like when you have stepped into another cell. But it won't send it for other frames, which is good.

this.scopes(sf.id);
// Only call scopes (and variables) if we are stopped on the cell we are executing
const cell = this.notebookDocument.cellAt(this.configuration.__cellIndex!);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this.configuration.__cellIndex always guaranteed to be defined here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in all cases, I'll use the notebook URI

if (sf.source && sf.source.path === cell.document.uri.toString()) {
this.scopes(sf.id);
}
});
}