Closed jdrese closed 3 months ago
Pyright (the type checker upon which Pylance is built), does not support dynamic modification of __path__
. Here are several old Pyright issues discussing this that have some more detail:
If I misunderstood what you were asking for here, feel free to provide more detail and reopen the issue. In that case, a repo or zip file with a folder structure that reproduces the issue would be helpful.
Environment data
Code Snippet
Repro Steps
__path__ = pkgutil.extend_path(__path__, __name__)
src
folder to a workspace"python.analysis.extraPaths"
to have auto complete and code intelissenceExpected behavior
Pylance should be able to pick up that the python packages are extending the namespace
Actual behavior
Pylance fails to read content of one of the packages.
Extra note
The
python.analisys.autoSearchPaths
does work correctly and if you are withing a same workspace that has all thesrc
folders within the space of the same root folder. Things work. But if another workspace is trying to "reference" code from another package it does not.