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

Re-run initialization when changing kernels in iw #7948

Merged
merged 1 commit into from
Oct 15, 2021
Merged

Conversation

DonJayamanne
Copy link
Contributor

For #7941
Changing controllers doesn't re-run the initialization scripts in interactive window

@DonJayamanne DonJayamanne requested a review from a team as a code owner October 15, 2021 19:55
const kernel = this.kernelProvider.getOrCreate(editor.document, {
metadata: controller!.connection,
controller: controller!.controller,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some cleanup

const notebookEditor = await this._editorReadyPromise;
const kernel = await this._kernelReadyPromise;
await this.updateOwners(fileUri);
const [notebookEditor, kernel] = await Promise.all([
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Parallelize, should be a little faster

this.internalDisposables.push(kernel);
await kernel.start();
this.fileInKernel = undefined;
await this.runIntialization(kernel, this.owner);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved initialization scripts to after kernel is created/started.
This way it happens everytime

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also passing the owner

@codecov-commenter
Copy link

Codecov Report

Merging #7948 (04c3c62) into main (ef6ed38) will increase coverage by 0%.
The diff coverage is 76%.

@@          Coverage Diff          @@
##            main   #7948   +/-   ##
=====================================
  Coverage     70%     70%           
=====================================
  Files        364     364           
  Lines      22427   22424    -3     
  Branches    3416    3416           
=====================================
- Hits       15882   15880    -2     
+ Misses      5171    5156   -15     
- Partials    1374    1388   +14     
Impacted Files Coverage Δ
...atascience/interactive-window/interactiveWindow.ts 59% <76%> (-1%) ⬇️
...datascience/editor-integration/codelensprovider.ts 69% <0%> (-2%) ⬇️
...client/datascience/kernel-launcher/kernelDaemon.ts 56% <0%> (-2%) ⬇️
src/client/datascience/jupyter/kernelVariables.ts 57% <0%> (-2%) ⬇️
src/client/datascience/jupyter/jupyterNotebook.ts 66% <0%> (-1%) ⬇️
src/client/common/errors/types.ts 52% <0%> (ø)
src/client/datascience/telemetry/telemetry.ts 81% <0%> (ø)
src/client/datascience/jupyter/kernels/kernel.ts 77% <0%> (ø)
...client/datascience/raw-kernel/rawJupyterSession.ts 72% <0%> (ø)
...ient/datascience/raw-kernel/rawNotebookProvider.ts 67% <0%> (ø)
... and 5 more

@DonJayamanne DonJayamanne merged commit 41c9da4 into main Oct 15, 2021
@DonJayamanne DonJayamanne deleted the issue7941 branch October 15, 2021 20:22
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.

4 participants