-
Notifications
You must be signed in to change notification settings - Fork 133
How to make python-language-server able to analyze symlinked modules? #1545
Comments
I don't think that's something the language server is involved in. All the language server returns is the filename and location in that file, and the editor is expected to do the rest. If the editor can't open that file, then it'd be the editor with the issue. The language server doesn't have any issue analyzing symlinked files to my knowledge (and symlinks are how virtual environments work on Linux and macOS). |
According to my test, vscode seems to utilize So my question is, do we need to pass additional module paths to language server if the user has some modification on |
The extension sets the PYTHONPATH environment variable when it starts the language server. It also combines extraPaths and PYTHONPATH together and sends a list of search paths in the initialization options, although that is no longer required as of #1492 (as the LS will now read PYTHONPATH directly from its environment like any program). If a language server client isn't starting with the environment of its parent process (which is presumably where you have PYTHONPATH set), then the LS wouldn't get that info. If your client is unable to set PYTHONPATH how you want it, you may also use extraPaths to specify the same list again, though there is currently more than one way to specify paths (still working to clean this up). |
I see. I finally get it working now! The problem is exactly my editor's (Emacs) language server didn't really utilizing PYTHONPATH as default. It has an additional variable Thanks for the help! |
I found vscode is able to jump to definition over the symlinked modules. While other editors utilizing python-language-server can't.
How to enable the ability analyze symlinked modules? Do we need to pass extra params?
Thank you!
The text was updated successfully, but these errors were encountered: