You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there's a private API that Pylance gets to use in order to determine the Python Env associated with Jupyter notebooks.
Unfortunately there are a few problems with this API:
Its built specifically for Pylance, other extensions cannot get this same information
Upon selecting a new Kernel, the Pylance extension won't always know that a new Python Env has been selected for a Jupyter Notebook
The API is inconsistent, currently there's an API in Python extension to get the Python Env associated with a Uri, but Jupyter Notebooks is not part of this (when Jupyter Notebooks are also just Uris).
Pros:
Unified approach to getting Python Environments for notebooks, Python files, workspaces etc.
No code change for extensions consuming the Python API
Resolves some bugs as well
Solution:
Keep the Python extension + Jupyter Extension API internal (as today)
Update the Python extension as follows:
exporttypeActiveEnvironmentPathChangeEvent=EnvironmentPath&{/** * Workspace folder the environment changed for. * Or Resource the environment changed for. */readonlyresource: WorkspaceFolder|Uri|undefined;};
Internally, the call to getActiveEnvironmentPath(resource?: Resource): EnvironmentPath; would now handle Uris a little differently. If the Uri is a notebook Uri, then get the interpreter from Jupyter extension (using existing code).
The check if the Uri is a notebook can optionally be passed into Jupyter as well, i.e. keep it super simple.
The text was updated successfully, but these errors were encountered:
DonJayamanne
added
bug
Issue identified by VS Code Team member as probable bug
and removed
bug
Issue identified by VS Code Team member as probable bug
labels
Sep 3, 2024
Currently there's a private API that Pylance gets to use in order to determine the Python Env associated with Jupyter notebooks.
Unfortunately there are a few problems with this API:
Pros:
Solution:
Internally, the call to
getActiveEnvironmentPath(resource?: Resource): EnvironmentPath;
would now handle Uris a little differently. If theUri
is a notebook Uri, then get the interpreter from Jupyter extension (using existing code).The check if the Uri is a notebook can optionally be passed into Jupyter as well, i.e. keep it super simple.
The text was updated successfully, but these errors were encountered: