-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No symbols found in Outline when in a multi-root workspace #1854
Comments
Ok, as commented in microsoft/python-language-server#1536 (comment), this seems to be a bug in vscode-python. A serious bug I would say because it kinda means that multi-root workspaces are not supported with the language server (?). |
Related to microsoft/vscode-python#5132, if not dup |
I think it's a dup but it's not making clear that it's strictly pls (not jedi) related and also it's a bit confusing by the fact it somehow relates the issue to venvs, which AFAICS have nothing to do with the problem (I'm not running inside a venv now and I can perfectly reproduce the issue). |
|
@DonJayamanne as for your first point, some things I could say aren't working are: empty outline for some files and also no ctrl-click style navigation for identifiers (as noted before, this happens for all files in a project or for no file in a project, and the failing projects vary from launch to launch, I think according to the first active editor but I can tell that for sure, it feels a bit random, but the first file always get an outline, for example). Regarding your third point, I'm not, all open files belong to one of the project folders. But the workspace settings file itself is in another directory, not in the same root containing the project folders. Regarding the second, I can't share the projects in my workspace but I will try to reproduce the issue in a minimal setting and send that to you; you will have to wait a few days though, since I'm very busy right now. Please read also the comments they made in microsoft/python-language-server#1536. |
Thanks for your patience. Will wait for your sample repo. In it future, please could you got the issue in one repo. |
It wasn't my intention, I let you both know that the issue was opened in both repositories, I thought it was better left to you to close one of them, but maybe it's preferable that you simply move issues between your repos, if that's possible. Here you have a minimal example. It contains a two folder workspace. I have a configured a virtual environment in the venv folder, you will have to configure |
@DonJayamanne please let me know if you need more info in order to reproduce the issue, since I still see the info-needed label. |
I'm experiencing this issue too. I usually have multiple folders from a common root folder loaded into VS Code (as I frequently bounce between projects), and I've noticed the Outline function for Python files never works, usually just saying "The active editor cannot provide outline information" (very rarely saying no symbols were found in the file). Normally I run the extension remotely, but I've also tested this with it loaded locally, and accessing files locally and remotely, and at best the first Python file I open gets an outline, and the rest don't. I've also checked multiple other languages (JS, JSON, CSS, etc.) on both local and remote, and none of them have any trouble with the outline. As soon as I remove all but one folder from the workspace, the outline fires up fine. Trying to restart the language server (or reloading the window for that matter) has zero effect while multiple folders are open. I've noticed in the output window for Python, it gives me several different errors when multiple folders are open:
The Language Server output remains blank as long as I've got multiple folders open. Here's my setup info for reference:
Any insight would be appreciated. I'd prefer to not have to keep four copies of VS Code open most of the time. Thanks! EDIT: I forgot to add, if I switch from the MS language server to Jedi, it still doesn't work, and I start getting error messages about "Failed to initialize experiments" or "Failed to download and store experiments". |
The issue is still persisting. Having the same setup as described by @Allerka and @memeplex (albeit on newer versions of both VS Code and the extension, and using different OS). The issue starts as soon as you're adding a folder to the Workspace with the option So it's not just 'having different folders open', but it's really tied to the Workspace. As long as the Workspace is tied to one 'root' folder, there's no issue. Outline works correctly as can be verified by the using the command As soon as you add another folder to your Workspace with the option The issue seems to be related to the Python extension, as the issue is not present with e.g. Markdown files. My setup:
Any other useful info I should mention? |
This is addressed with language server setting as |
I guess this too is #1823, but again, we don't even receive the request when this happens. This can't be a Pylance problem, this is a client problem. |
Hm, no, this may be slightly different, relating to adding workspaces? @aarwurzer2 @karthiknadig Do any features work when you do the above? Or is it only the outline that is broken? |
it doesn't repro. I can see outlining for files under multi workspace root in the latest pylance. |
I've reported the following bug to the MS-PLS tracker:
microsoft/python-language-server#1536
But maybe it belongs here. I let you decide.
Environment data
Expected behaviour
See link above.
Actual behaviour
See link above.
Steps to reproduce:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: