pylance-release
pylance-release copied to clipboard
Code navigation can open the destination in the actual path instead of symlinked path if symlinked directory was added to workspace
Environment data
- Language Server version:
2022.7.20 - OS and version: Windows 10, 19043
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.5
Code Snippet
# In mycode/test.py
import somelib
# Make sure that `somelib`'s folder is added to the current VS Code workspace
somelib.somefunc()
# [Go to definition] on `somefunc`
Repro Steps
- See the code snippet above.
- Note that before navigating to definition for the function, you would be in
mycode/test.py. - Create a symlink to
/full/path/.../someliband add the symlink directory to the VSCode workspace. - Navigate to
somefuncfrom withintest.py.- You should be in
somelib/__init__.pyas seen in the breadcrump bar, as expected for directories added to the workspace.
- You should be in
- But instead, you may actually find yourself in,
/full/path/.../somelib/__init__.py. - This breaks many other features, like the python version used that's assigned to
somelib's workspace entry. If you get served the version of the file with its full path, it's not considered part of the workspace.
Expected behavior
XXX
Actual behavior
XXX
Logs
Trying to extract this in a clean environment.
XXX