-
Notifications
You must be signed in to change notification settings - Fork 797
Speed up the autocomplete and filter feature. #2889
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
Thanks for testing in neovim. Are any of the projects you experience this with open source? We should confirm the latency distribution of completion handling. Can you start gopls with Another possibility is that completion is backed-up behind another request. RPC logs would tell that story, but are harder to read (and not safe to share if the project is private). Do you have any custom settings? In particular |
For the open source project ( I only test K8S, which is big I think) , VSCode works fine. I guess it might be caused by some big source file generated by thrift in my private project. And sorry for the RPC logs because the code belongs to my Company :(. |
I am having the same issue. |
I can't quite remember the actual steps I did. But I think I was just following the steps in this document. https://go.googlesource.com/tools/+/refs/tags/gopls/v0.4.2-pre1/gopls/doc/troubleshooting.md type this in the
and fetch the debug info with url in the setting. In addition, I partly solve this problem by updating gopls to latest version in which they fix the OOM issue and disabling the lint like I don't think vscode-go can do much about the parsing speed because that's I also compare the action taken by vscode-go and Goland, I notice that even in Goland, it still stucks a little if the package is extremely large. But in Goland, it shows something first, and then add the rest in one or two seconds. With vscode-go, everything shows up at once, so the feeling will be different even though both take the same time. |
Yes, one of the problems we face here is the fact that VS Code does not support streaming auto complete suggestions. So we have to strike a balance between latency and completeness. |
@Kidsunbo could you try with gopls@master? I believe you may be running into golang/go#/62665, which was just fixed. To install gopls@master:
|
Yes, the speed is much faster than before and it's much enjoyable with the master version. When will it be released? BTW, thank you for the improvement. |
Thanks for confirming. I plan to cut a prerelease containing the fix tomorrow or Monday, with a full release in a few weeks. |
Is your feature request related to a problem? Please describe.
For some small projects, everything works fine and smoothly. But for some projects which contains big files with more than 150,000 loc. The autocomplete and filter when typing works but extreme slow. For the same project, GoLand and NeoVim with gopls all takes one second to give the sugguestion. But with VSCode with go extension, it takes more than 4 seconds which is almost intolerant.
Is there a way to speed up such feature?
Describe the solution you'd like
VSCode gives the autocomplete suggestion and filter less than 1 seconds for structs from big package. Just like GoLand and NeoVim do.
Describe alternatives you've considered
I was thinking it's related to gopls, but I've also tried it with NeoVim, it works fine. For some small project, it gives the autocomplete much faster than that in big project.
Additional context
I notice that in GoLand, the autocomplete starts from few suggestions and then appended to all suggestion. But in VSCode, it will give out all suggestion at once but it takes some time.
The text was updated successfully, but these errors were encountered: