-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
With the multi-root workspace support added in #4244, files which do not reside in a workspace (including library code that doesn't live in a virtualenv inside the opened folder) are not properly classified, and the extension/editor does not recognize them. This affects goto-def (see microsoft/python-language-server#840), but also opening random files that aren't in the currently open folder.
This behavior likely comes from this line: https://github.com/Microsoft/vscode-python/pull/4244/files#diff-f60110caa225d7026d0cffec5d66270fR109
Which I interpret to mean "only treat files within this root as Python", as well as to help distinguish one workspace from another. This has the unfortunate side effect of preventing files that don't match those patterns from "being" Python and then handled by the extension.
Interestingly, if you open a file (and have it not be recognized), then reload VS Code, then the file is recognized as normal, which may hint that there's a way to avoid the problem (or that it's just a bug).