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

Refactor preferred controller for interactive #6642

Merged
merged 2 commits into from
Jul 12, 2021
Merged

Conversation

DonJayamanne
Copy link
Contributor

No description provided.

@@ -238,19 +236,8 @@ export class NativeInteractiveWindowProvider implements IInteractiveWindowProvid
}

private async getControllerForInteractiveWindow(): Promise<string | undefined> {
// Fetch the active interpreter and use the matching controller
const api = await this.pythonApi.getApi();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic for what's the preferred should be in the manager (that's where it is today for native notebooks).

public async getInteractiveController(): Promise<VSCodeNotebookController | undefined> {
// Fetch the active interpreter and use the matching controller
const api = await this.pythonApi.getApi();
const activeInterpreter = await api.getActiveInterpreter();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change also makes it easier for #5861
Else we have to change a few places, when ideally we should have the controllers created & return from a single place.

@DonJayamanne DonJayamanne marked this pull request as ready for review July 12, 2021 19:33
@DonJayamanne DonJayamanne requested a review from a team as a code owner July 12, 2021 19:33
Copy link
Contributor

@joyceerhl joyceerhl left a comment

Choose a reason for hiding this comment

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

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2021

Codecov Report

Merging #6642 (d4c1a5d) into main (d20d44f) will decrease coverage by 1%.
The diff coverage is 33%.

❗ Current head d4c1a5d differs from pull request most recent head ed4940d. Consider uploading reports for the commit ed4940d to get more accurate results

@@           Coverage Diff           @@
##            main   #6642     +/-   ##
=======================================
- Coverage     64%     63%     -2%     
=======================================
  Files        352     409     +57     
  Lines      24542   28249   +3707     
  Branches    3750    4195    +445     
=======================================
+ Hits       15930   17944   +2014     
- Misses      7194    8712   +1518     
- Partials    1418    1593    +175     
Impacted Files Coverage Δ
src/client/datascience/notebook/types.ts 100% <ø> (ø)
...eractive-window/nativeInteractiveWindowProvider.ts 16% <33%> (ø)
.../datascience/notebook/notebookControllerManager.ts 78% <33%> (ø)
src/client/common/platform/fileSystemUtils.ts 9% <0%> (-84%) ⬇️
src/client/common/net/fileDownloader.ts 21% <0%> (-79%) ⬇️
src/client/common/utils/multiStepInput.ts 10% <0%> (-65%) ⬇️
src/client/datascience/shiftEnterBanner.ts 27% <0%> (-64%) ⬇️
...cience/data-viewing/dataViewerDependencyService.ts 25% <0%> (-62%) ⬇️
...ient/datascience/jupyter/jupyterPasswordConnect.ts 12% <0%> (-59%) ⬇️
src/client/pythonEnvironments/info/executable.ts 42% <0%> (-58%) ⬇️
... and 242 more

@DonJayamanne DonJayamanne requested a review from joyceerhl July 12, 2021 20:31
@DonJayamanne DonJayamanne merged commit 5eeba90 into main Jul 12, 2021
@DonJayamanne DonJayamanne deleted the miscRefactor branch July 12, 2021 21:15
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