-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Symbol navigation via ctrl-t does not work when the microsoft language server is enabled (jedi disabled) #2637
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
Comments
I will try to verify. |
This is triggering an error, so I have reported it upstream. |
@brettcannon I tried with today's release (2018.10.0) of the VSCode Python extension, I got the message telling me the language server was updated but I still cannot get ctrl-t to work when working on a local clone of the https://github.com/scikit-learn/scikit-learn repo. With the new version update ( @MikhailArkhipov is there any command to launch from the command line that could help get a more verbose diagnostics on what's going on? More importantly the |
Actually after a while I got the following error messages in the output panel of VS Code:
|
I opened microsoft/python-language-server#378 upstream. |
Now that microsoft/python-language-server#378 (@jakebailey and @MikhailArkhipov) is closed, I have tried again today with Python extension 2018.11.0 and languageServer 0.1.65 and I no longer get the error message (or any languageServer output) in the output panel of vscode but the symbol navigation still does not work: same behavior as before when I do a ctrl-T + name of a scikit-learn class such as KMeans or any other class or function name. The languageServer is still using 100% of one or 2 CPUs in the background (for several minutes). On the same git clone, jedi / ctags indexes the symbols much faster (less than a minute I would say) and navigation works as expected. |
We fixed the bugs causing the errors, however we have not yet removed the big "wait until analysis is complete" blockers in those "find-something" calls (see microsoft/python-language-server#378 (comment)). Not being able to make those calls is for now still the implemented behavior. You may be interested in watching microsoft/python-language-server#433, which aims to solve the problem a different way. I may still try removing those blocks to see what happens, though. |
How long is it reasonable to "wait until analysis is complete" though? It looks like analysis is never complete on the codebase that I'm using this on. Same behaviour. 100% CPU and no error messages. Intellisense seems to work fine. I want to switch away from jedi/ctags because that also has issues, but until |
You can increase the logging level and watch the Python output panel for the language server output: "python.analysis.logLevel": "Trace" When it's actually done, it'll say "analysis complete for ... <filename>". Additionally, there is a file named Intellisense will work because we don't wait for the full analysis to complete before returning results. This is not true for go-to-X/find-X, but is not the intended final behavior (see my previous comment). |
@jakebailey thanks. I did that for the scikit-learn project and here is the output log: https://gist.github.com/ogrisel/a49fc97204f6964dc3a6edf3dbf3d7bd I just open vscode on the In the first couple seconds I get the output log linked above. But after that nothings happens: the The only analysis that can complete is the analysis of the toplevel |
I have also tried to delete non-library folders like |
Just to link it here: microsoft/python-language-server#521 reworks how we work with symbols and movesit out of the analysis. Testing on 0.1.77 (which includes that PR), in The CPU usage is another issue, tracked in microsoft/python-language-server#479 and microsoft/python-language-server#495, which are being addressed separately. |
@jakebailey great news! How to get language server 0.1.77 in vscode? I only get the older 0.1.75 at the moment. $ ls ~/.vscode/extensions/ms-python.python-2018.12.1/ | grep languageServer
languageServer.0.1.75 I have tried to reinstall the ms python extension and delete de languageServer folder but I still get 0.1.75 each time. |
It's currently in our daily and beta channels, not the stable release (since it's brand new). You can switch to one of those to test a non-stable build by setting one of the following in your settings: "python.analysis.downloadChannel": "daily" "python.analysis.downloadChannel": "beta" If you want to go back to stable, you can remove that line and delete the folders with names starting with |
I confirm that the Go To Symbol feature works on scikit-learn when using the beta channel. Thank you very much. Looking forward to the resolution for the CPU usage issue now :) The trace output shows that the language server never seems to get back analysis results for the majority of the files of the project: only the first queued file (in my cases setup.py) ever receives an analysis back from the language server. All the other queued files seem to be stalled and CPU usage stays at 100% forever without any output in the trace-level log. Feel free to close this issue if you wish, as the symbol navigation part is fixed. |
FYI: I switched to the beta channel, and Go To Symbol, Outline, etc are working now. 100% CPU issue is still there though. I set the log level to Edit: Nvm. I read the logging output wrong. It was just all of my project's files being queue for analysis. |
Yes, that's the issue I was referring to above, which we're handling a different way (by reworking our analysis as a whole). The CPU usage will be high depending on the project, but completion/hover/etc should still be available, though may be incomplete depending on where the language server has gotten stuck. |
I observe the same behavior on scikit-learn. |
The problem is not so much that the CPU usage is high but instead that the analysis seems to get stuck and never progresses. The analysis process seems to be caught in some kind of infinite loop or something similar. |
I'm closing this as per ogisel saying he was satisfied with the result (which is now out publicly as part of the January 2019 release of the extension). |
Environment data
Steps to reproduce:
Disable jedi in settings.json. Here the full settings.json I used to make sure that this issue is not caused by a problem in my config:
Then try with the following mixed Python/Cython/C/C++ code base:
Then hit "ctrl-t" and type "KMeans" for instance.
Actual behavior
The ctrl-t menu is never populated as expected (it stays empty). I have the same problem with other symbols defined in this project (e.g.
LogisticRegression
,check_array
...).The "Analysing workspace, 1 item remaining..." message never goes away.
Weirdly enough, hitting "F12" on a Python symbol defined in the workspace can make VS code navigate to it successfully. It's just the
ctrl-t
symbol search menu that's broken.Expected behavior
Being able to open the
k_means_.py
file from the project folder in the workspace to navigate to the definition of theKMeans
class.Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)Also note that jedi has no problem with this workspace.
The text was updated successfully, but these errors were encountered: