-
Notifications
You must be signed in to change notification settings - Fork 133
'Go To Definition' takes many minutes to resolve in a moderately-sized project #492
Comments
At this point "many minutes" is an understatement. I don't think the F12 keypress is ever going to resolve. I found the suggestion to set "Python > Analysis: Log Level" to Trace. Now I can see that the Language Server's last output is that it is trying to analyze a file that I have deleted since the time I opened the folder. This may be relevant. |
I restarted VS Code, went to the same file and pressed F12 again. This time there's almost no tracing output in the Python output window, only this:
Despite that it's not complaining about a deleted file this time, the spinner is still going and the F12 keypress is not resolving. |
Oh! That one finished in about 2 minutes. All the language server tracing output appeared all at once, at the end. It contains hundreds of lines like It's good that the analysis includes definitions in other repositories, but it's unfortunate that the language server has to wait for every file to be analyzed before it can go to a definition in any file. The overall result is still that "Go To Definition" is very slow and has no indication of progress, and also it seems that deleting a file may prevent it from working until you restart VS Code. |
Go to definition (and other similar functionality) is limited by the analysis completing in many cases. We are currently working on a number of things which should speed up analysis as well as allow for go to def/find symbol/etc to operate without the rest of the analysis completing. Most of the logging done by the language server shows up in |
I have the same issue. When language server engine is selected, I can't get autocomplete or goto (basically anything) even for a moderately small project. Vscode just shows a "loading" spinner that never ends.
I have lots of these in vscode -> output -> python. |
I am encountering the same problems. The Python Language Server in VS Code is unsuitable for production work in a large codebase. The analysis never finishes, the outline view never populates, and the peek/go-to definition commands do nothing as they have no information on which to act. My options are to use Jedi, which is a resource hog, but mostly works, or to switch to a Python related IDE such as Wing or PyCharm that doesn't have these issues. |
Agreed. I use VSCode as my editor of choice for work but PLS is completely unusable because it takes a ridiculously long time to start up and eats up 100% of my CPU usage in a reasonably large project. I've had to rely on Jedi which is pretty slow for tasks like Go to Symbol in Workspace but at least functions. (simple repro - clone the pandas repo and try to do a symbol search). |
Finding symbols (+outline) and goto def are slightly different in practice. The former is slated to be handled by #521 (once I clean it up), which moves symbol indexing in parallel with the other analysis. Goto def is tied to the analysis (since we need to gather references), but may be improved with the new analysis. |
#567 |
0.2.16 is now available on beta channel. "python.analysis.downloadChannel": "beta" |
I tried to switch from Jedi to Python Language Server. DonJayamanne, at microsoft/vscode-python#2790, hinted that Jedi would become unsupported, and suggested creating bugs about why Python Language Server is unusable.
I switched off Jedi, restarted VSCode, opened the project I was working on (which sloccount estimates at about 4000 lines of code), and pressed F12 on a pretty typical local import, which looked like this:
A busy indicator (without an indication of progress) started moving under the tab bar. 15 minutes later, it's still going.
I would like to be able to provide more information, such as debug output from the language server, so I can tell what kind of rabbit hole it's falling down. But I can't locate any more information at the moment.
I am using VS Code 1.30 on Ubuntu 18.04, running Python 3.6.5 in a virtualenv.
The text was updated successfully, but these errors were encountered: