-
Notifications
You must be signed in to change notification settings - Fork 771
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
Go to symbol in Workspace very slow and lists non-workspace objects #34
Comments
Symbol searching in Pylance is based on the analysis, but the symbol searching in MPLSv1 was a separate index in parallel that didn't involve the analysis (but would get things "wrong" as it has no context). So there are a few things (@robintw if you could answer the questions in the notes below, I'd appreciate it):
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for the prompt responses on this! In response to @jakebailey's questions: Note: All of the results below were obtained from a newly-installed copy of VS Code Insiders, with the Python extension and Pylance installed. Cloning https://github.com/robintw/Py6S and adding it as a workspace folder, opening a .py file (to load the extension) and then pressing Cmd-T and searching for This shows a few I hope that answers most of your questions - let me know if you need any more information. |
Ah, I see what you mean by We're returning results from our copy of the typeshed stubs, which isn't intended and likely the same issue as conda. These should be getting filtered to workspace only. Ensuring we only search the workspace would likely also help the performance. |
I am having the same problem, but I don't use conda. The first search I make into Quick Open binds and parses not only every file in my workspace, but every file in my |
This feature is being worked on, and we will be limiting workspace symbols to only things in the workspace (that aren't also say, in a venv) pending an overhaul of how symbols work. |
Quick fix while they're working this out: I found that disabling "Python Analysis: Use Library Code for Types" greatly speeds up search and no longer includes site-packages functions. |
@vkramanuj This worked for me! Now it only includes the pylance code but not everything else in site-packages. Thank you! |
Note that doing this means we are no longer scanning library code for info, and any library that doesn't have stubs will no longer work. This might work fine for some libraries, but I would expect it to not work so well for many others. |
Understood. I think getting it to work better on my own code outweighs the loss of functionality in other libraries for me, but can see that it wouldn't work for others. |
This should be fixed in the next release, which pulls in a fix to only search / return results from user code. |
This issue has been fixed in version 2020.8.2, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202082-20-august-2020 |
Environment data
Expected behaviour
Running Go To Symbol In Workspace (Cmd-T) will allow me to search quickly for a symbol in my workspace.
Actual behaviour
When I press Cmd-T and start typing, I get a progress bar/activity indicator along the bottom of the text entry field. It sits there processing for quite a while, and then eventually gives me a list of symbols. This is significantly slower than when using the standard MS Python Language Server. The first time I run it after starting VS Code it takes multiple minutes to run, subsequent times it takes a few seconds: the standard MS Python Language Server is almost instant.
When the list of symbols is displayed, it shows me all sorts of strange symbols from code inside the
.vscode
folder, and code in some of the Python packages installed in my conda environment. With the standard MS Python Language server it only showed me symbols from within my workspace.Logs
I've put the log output in a Gist here as it is very long.
It seems like it is searching all across my entire Python environment, rather than just in my workspace...that would explain why I'm getting so many extra results, and it is taking so long.
The text was updated successfully, but these errors were encountered: