-
Notifications
You must be signed in to change notification settings - Fork 294
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
Change the logic for when we show the "Install Python (Extension)" commands #10584
Change the logic for when we show the "Install Python (Extension)" commands #10584
Conversation
Per good suggestion from @rchiodo. The old dummy command logic for when it showed I just ported directly to the new commands, but with the new commands we can improve that logic some. Old Logic: New logic: Restricts it to python or unknown files. And if you happen to have a globally detected python kernel already on this system this will still provide the extension install command in the picker to suggest that you can install python to detect more kernels and for a better experience. |
if (language && language !== this.lastSavedNotebookCellLanguage) { | ||
await this.globalMemento.update(LastSavedNotebookCellLanguage, language); | ||
} | ||
} | ||
private getLanguageOfFirstCodeCell(doc: NotebookDocument) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't need to be part of the class, and I needed it, so moved it out to a helper. Mild rename since the old name didn't seem quite accurate (it's more about getting the language of the document, not just the first cell as it prefers metadata over the first cell lang).
Codecov Report
@@ Coverage Diff @@
## main #10584 +/- ##
======================================
Coverage 71% 71%
======================================
Files 472 473 +1
Lines 28013 28025 +12
Branches 4697 4698 +1
======================================
+ Hits 19943 19963 +20
+ Misses 6196 6186 -10
- Partials 1874 1876 +2
|
Fixes #10583
package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).