-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Default cell language for native notebooks #14314
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
Default cell language for native notebooks #14314
Conversation
789c6ac
to
640dfab
Compare
@@ -3344,6 +3344,16 @@ | |||
"extensions": [ | |||
".ipynb" | |||
] | |||
}, | |||
{ | |||
"id": "julia", |
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.
Julia isn't a built in language in VSCode. We need this if julia users want to use our native notebooks.
All we're doing here is registering a language that will appear in the languages dropdown.
f2b1104
to
9ca22c7
Compare
); | ||
// If we do not have kernel spec metadata, but have the language name, then use that to find a kernel | ||
// Else use the kernel spec metadata. | ||
const query = |
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.
Support for searching for a kernel based on langauge.
When creating blank notebooks, ipynb metadata will be empty (we cannot pre-emptively add metadata when all we know is the language of the cell).
Rules here #13522 , #13520
/** | ||
* Responsible for determining the default language of a cell for new notebooks. | ||
* It should not always be `Python`, not all data scientists or users of notebooks use Python. | ||
*/ |
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.
Rules here #13522 , #13520
// THe problem is we need to overide this behavior, however the overriding doesn't work in JS | ||
// as some of the dependencies passed as ctor arguments are not available in the ctor. | ||
// E.g. in the ctor of the base class, the private members (passed as ctor ares) initialized in child class are not available (unlike other languages). | ||
if (initializeJsonIfRequired) { |
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.
Interesting behaviour with inheritance & ctors in Js, not the same in other laguages.
Solved by passing an argument.
interpreter | ||
}; | ||
// Install missing depednencies only if we're dealing with a Python kernel. | ||
if (interpreter && isPythonKernelConnection(connectionInfo)) { |
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 incorrect.
If we're running a Julia kernel, we're prompting the user to install ipykernel.
The tests we have should catch any issues here.
Codecov Report
@@ Coverage Diff @@
## main #14314 +/- ##
==========================================
- Coverage 59.91% 59.43% -0.49%
==========================================
Files 709 716 +7
Lines 39334 39987 +653
Branches 5698 5795 +97
==========================================
+ Hits 23567 23765 +198
- Misses 14529 14965 +436
- Partials 1238 1257 +19
Continue to review full report at Codecov.
|
Kudos, SonarCloud Quality Gate passed!
|
For #13522 , #13520 * Do not prompt to install ipykernel for non-python kernels * Default the cell of the next blank notebook to language of last saved/used notebook. * Ability to search for kernels based on language (even if kernel spec is not available) * Added Julia language, so users can install this extension and run Julia kernels (remember, they need to select a `Jualia` language in the cell of a VSCode native editor. However Jualia is not a built in language. Will need to submit a PR upstream). * Added tests
* Remove cell index property and use build in prop (#14239) * Update other cells in cell execution (#14240) * Tests for prompting to install missing ipykernel (#14266) * Treat Native notebook tests as VS Code tests (#14282) * Fixes to blowing away of kernel info & not using right startup info (… … * Default cell language for native notebooks (#14314) * Ignore formatting in ipynb when dealing with trust (#14333) * Fixes to trust service (#14352) * Change `IPython kernel` to `Jupyter kernel` (#14375) * Trust for native notebooks (#14353)
For #13522 , #13520
Jualia
language in the cell of a VSCode native editor. However Jualia is not a built in language. Will need to submit a PR upstream).Pending