-
Notifications
You must be signed in to change notification settings - Fork 300
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
Leverage new Python API to pass python.exe path for notebook to Pylance #9842
Conversation
|
Codecov Report
@@ Coverage Diff @@
## main #9842 +/- ##
=====================================
Coverage 63% 63%
=====================================
Files 216 216
Lines 10133 10135 +2
Branches 1614 1614
=====================================
+ Hits 6480 6484 +4
+ Misses 3134 3133 -1
+ Partials 519 518 -1
|
…from node_modules/@jupyterlab/coreutils
Test failure is due to #10046 |
Contributes to https://github.com/microsoft/pyrx/issues/2343
When Pylance's LSP notebooks experiment is enabled, the Python extension will be responsible for starting Pylance and therefore also needs to be able to provide the python.exe path. This change leverages a new Python API called
registerJupyterPythonPathFunction
to hook into Pylance's config setting requests and provide the python.exe path for a notebook's kernel.Jupyter's default behavior is unchanged. It only uses the new behavior when the experiment is enabled via the
python.pylanceLspNotebooksEnabled
setting.The related Pylance changes are in this PR: https://github.com/microsoft/pyrx/pull/2382
The related Python changes will be coming soon. They are currently blocked on upgrading Python's LSP version.
@rchiodo
Happy to add unit tests if you think they would be valuable.
I didn't see any mention of Pylance in the test plan, so I didn't make any changes there.
Has a news entry file (remember to thank yourself!).Has telemetry for enhancements.Unit tests & system/integration tests are added/updated.Test plan is updated as appropriate.package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).