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

Fix interactive window debugging with ipykernel6 #6691

Merged
merged 14 commits into from
Jul 17, 2021
Merged

Fix interactive window debugging with ipykernel6 #6691

merged 14 commits into from
Jul 17, 2021

Conversation

DonJayamanne
Copy link
Contributor

For #6534

@DonJayamanne DonJayamanne requested a review from a team as a code owner July 16, 2021 18:15
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2021

Codecov Report

Merging #6691 (55f4c18) into main (ee7729a) will decrease coverage by 0%.
The diff coverage is 75%.

@@          Coverage Diff           @@
##            main   #6691    +/-   ##
======================================
- Coverage     69%     68%    -1%     
======================================
  Files        412     412            
  Lines      28473   28599   +126     
  Branches    4241    4269    +28     
======================================
- Hits       19825   19715   -110     
- Misses      6991    7206   +215     
- Partials    1657    1678    +21     
Impacted Files Coverage Δ
...ence/interactive-window/nativeInteractiveWindow.ts 5% <0%> (-1%) ⬇️
src/client/datascience/jupyter/kernels/types.ts 100% <ø> (ø)
src/client/debugger/jupyter/debuggingManager.ts 31% <ø> (-4%) ⬇️
...ent/datascience/jupyter/kernels/kernelExecution.ts 67% <33%> (ø)
...t/datascience/notebook/vscodeNotebookController.ts 77% <60%> (-3%) ⬇️
src/client/datascience/jupyter/kernels/kernel.ts 62% <62%> (-4%) ⬇️
...ient/datascience/jupyter/kernels/kernelProvider.ts 94% <88%> (-2%) ⬇️
.../datascience/interactive-common/interactiveBase.ts 70% <100%> (+<1%) ⬆️
src/client/datascience/jupyter/jupyterDebugger.ts 71% <100%> (+<1%) ⬆️
...ent/datascience/notebook/notebookDisposeService.ts 92% <100%> (ø)
... and 28 more

@@ -88,7 +88,8 @@ export class Kernel implements IKernel {
private readonly kernelExecution: KernelExecution;
private startCancellation = new CancellationTokenSource();
constructor(
public readonly uri: Uri,
public readonly notebookUri: Uri,
public readonly resourceUri: Uri,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Today in our notebook provider we have the distinction between IdentityUri & ResourceUri.
This change merely ensures we support that in the IKernel object as well.

identity: this.uri,
resource: this.uri,
identity: this.notebookUri,
resource: this.resourceUri,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now, we're passing the right resource, else we'd be passing the Uri of the Interactive Notebook Uri instead of the the Python file Uri (i.e. works the way it did with inteactive webview)

*/
get(uri: Uri): IKernel | undefined;
get(notebook: NotebookDocument): IKernel | undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't want to keep the Uri, its too ambiguous,
this way we're very explicit.

@@ -257,9 +259,10 @@ export class NativeInteractiveWindow implements IInteractiveWindowLoadable {
}

private registerKernel(notebookDocument: NotebookDocument, controller: VSCodeNotebookController) {
const kernel = this.kernelProvider.getOrCreate(notebookDocument.uri, {
const kernel = this.kernelProvider.getOrCreate(notebookDocument, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No ambiguity with the argument now, we pass the document, else if it was uri, one could accidentally provide the resource Uri (owning uri)

@DonJayamanne DonJayamanne requested a review from joyceerhl July 16, 2021 19:36
Copy link
Contributor

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

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

⏲️

@DonJayamanne DonJayamanne requested a review from rchiodo July 16, 2021 21:58
@rchiodo
Copy link
Contributor

rchiodo commented Jul 16, 2021

Just waiting on the suggestion that Joyce made. Otherwise looks good to me

@DonJayamanne DonJayamanne requested a review from joyceerhl July 16, 2021 22:17
@DonJayamanne
Copy link
Contributor Author

ust waiting on the suggestion that Joyce made. Otherwise looks good to me

@joyceerhl thanks for the explanation, initially i didn't quite understand that. It makes perfect sense. Updated the PR. Please check
@rchiodo it should be simpler now.

@DonJayamanne DonJayamanne merged commit 2004ee9 into main Jul 17, 2021
@DonJayamanne DonJayamanne deleted the issue6534 branch July 17, 2021 00:26
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.

5 participants