-
Notifications
You must be signed in to change notification settings - Fork 304
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
Fixes & minor cleanup of kernel finder #5824
Conversation
if (r.kind !== 'connectToLiveKernel' && r.kernelSpec) { | ||
if ( | ||
r.kernelSpec.metadata?.vscode?.extension_id && | ||
this.extensions.getExtension(r.kernelSpec.metadata?.vscode?.extension_id) |
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.
Moved to a common location (localKernelFinder.ts
)
Codecov Report
@@ Coverage Diff @@
## main #5824 +/- ##
=======================================
- Coverage 72% 63% -9%
=======================================
Files 403 403
Lines 26946 26953 +7
Branches 3932 3933 +1
=======================================
- Hits 19425 17037 -2388
- Misses 5889 8503 +2614
+ Partials 1632 1413 -219
|
score = 1; | ||
} | ||
// Give python 3 environments a higher priority over others. | ||
// E.g. if we end up just looking at the suppof ot ehe languages, then Python2 & Python3 will both get 1. | ||
// But Python 3 is definitely preferred over Python 2. | ||
if ( | ||
speclanguage === PYTHON_LANGUAGE && | ||
nbMetadataLanguage === PYTHON_LANGUAGE && |
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.
This was wrong
@@ -471,14 +471,19 @@ export function findPreferredKernel( | |||
} | |||
|
|||
// Find a kernel spec that matches the language in the notebook metadata. | |||
if (score <= 0 && speclanguage === (nbMetadataLanguage || '')) { | |||
if (score <= 0 && nbMetadataLanguage && speclanguage === (nbMetadataLanguage || '')) { |
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.
This is incorrect, we need to ensure we have a language, else we match anything that doesnt' have a language or for those where it cannot be determined.
Fix to address a broken test
(tough when CI is busted)