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

Rob's comments and update variable view when done debugging #7527

Merged
merged 10 commits into from
Sep 15, 2021

Conversation

DavidKutu
Copy link

For #7323 and Rob's comments here

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).

David Kutugata added 5 commits September 14, 2021 13:29
-when the debugging manager is done debugging,
debuggerVariables calls for a variable view refresh
@DavidKutu DavidKutu requested a review from a team as a code owner September 14, 2021 23:36
public readonly config: DebugConfiguration,
options?: DebugSessionOptions
) {
this.session = new Promise<DebugSession>((resolve, reject) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

You might try using a deferred object for this idea of remembering the promise resolve/reject.

If you create a deferred object, you can implement resolve/reject with it.

const sf = stResponse.stackFrames[0];
const mode = this.debuggingManager.getDebugMode(doc);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let scopesResponse: any | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Why any?

// Call variables
if (scopesResponse) {
// Keep track of variablesReference because "hover" requests also try to update variables
const newVariablesReference = scopesResponse.scopes[0].variablesReference;
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure you only want to update the first scope?

Copy link
Author

Choose a reason for hiding this comment

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

no hahah

@@ -300,10 +267,6 @@ export class DebuggerVariables extends DebugLocationTracker

this.updateVariables(undefined, message as DebugProtocol.VariablesResponse);
Copy link
Member

Choose a reason for hiding this comment

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

Can't this stuff be deleted, it seems like you copied the code to line 469

Copy link
Author

Choose a reason for hiding this comment

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

I thought it was needed, but after testing, its not, I'll remove it.

/**
* Called for every event sent from the debug adapter to the client. Returns true to signal that sending the message is vetoed.
*/
willSendEvent(msg: DebugProtocolMessage): Promise<boolean>;
onWillSendEvent(msg: DebugProtocolMessage): Promise<boolean>;
Copy link
Member

Choose a reason for hiding this comment

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

Usually I feel that events start with on..., this is a method and not an event. I don't know if your codebase has the same pattern, it's up to you

Copy link
Author

Choose a reason for hiding this comment

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

true, that would be confusing, I'll put it back

David Kutugata added 2 commits September 15, 2021 09:44
-remove duplicated code
@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2021

Codecov Report

Merging #7527 (af79fd4) into main (aa42533) will decrease coverage by 0%.
The diff coverage is 18%.

@@          Coverage Diff          @@
##            main   #7527   +/-   ##
=====================================
- Coverage     66%     66%   -1%     
=====================================
  Files        364     365    +1     
  Lines      22618   22638   +20     
  Branches    3446    3442    -4     
=====================================
+ Hits       15072   15081    +9     
- Misses      6248    6259   +11     
  Partials    1298    1298           
Impacted Files Coverage Δ
src/client/debugger/jupyter/kernelDebugAdapter.ts 6% <0%> (ø)
src/client/debugger/types.ts 100% <ø> (ø)
...rc/client/datascience/jupyter/debuggerVariables.ts 18% <4%> (+<1%) ⬆️
src/client/debugger/jupyter/debugger.ts 11% <11%> (ø)
src/client/debugger/jupyter/debugControllers.ts 10% <100%> (ø)
src/client/debugger/jupyter/debuggingManager.ts 25% <100%> (+2%) ⬆️
...tascience/jupyter/kernels/kernelCommandListener.ts 55% <0%> (-3%) ⬇️
...science/jupyter/kernels/kernelDependencyService.ts 83% <0%> (-3%) ⬇️
src/client/datascience/jupyter/jupyterNotebook.ts 24% <0%> (-1%) ⬇️
... and 2 more

@@ -41,7 +41,7 @@ export class DebugCellController implements DebuggingDelegate {
}
}

export class RunByLineController implements DebuggingDelegate {
export class RunByLineController implements IDebuggingDelegate {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, do we need all of these interfaces? Why can't we just use classes

Copy link
Author

Choose a reason for hiding this comment

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

We were following the extension patterns.

}

async stop() {
void debug.stopDebugging(await this.session);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this async if we're ignoring the promise returned by debug.stopDebuggin

Copy link
Author

Choose a reason for hiding this comment

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

because we have to wait to get the session

@DavidKutu DavidKutu merged commit 2fab8fb into main Sep 15, 2021
@DavidKutu DavidKutu deleted the david/RBLVariablesComments branch September 15, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants