-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: reloading packages on every keystroke #42932
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
Do you mind sharing a log (details on how to capture one here: https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs)? |
The repo I am working on is on the large side, and I can very easily force the appearance of the "getting code actions" popup by just typing any long string in the code editor, like This is gopls v0.5.4 |
I get the same behaviour - the gopls functionality is virtually unusable for me at this stage. |
Yes, I agree. I will be turning it off until this is fixed. |
Sounds like a duplicate of #42813 See https://github.com/golang/tools/blob/master/gopls/doc/user.md#unstable-versions for the instruction. |
Oh, nice. Will try as soon as I can. Thanks. |
Duplicate of #42813 |
We'll be releasing gopls/v0.5.5 today with this fix. |
Thanks - will give it a go! |
I have updated to v0.5.5 now, but the problem is still there. I see no difference. |
@hwsoderlund: Can you please share a log by following the steps here? https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs |
First I was going to write this:
However, after having used VS Code for a few hours, editing yaml files mostly, I tried again, and then it was back to the previous bad behaviour again. Logs (anonymized) from about 1s before I started typing
|
Is it possible that you've installed any of the extensions described here? golang/vscode-go#236 (comment) Also, can you please share the first part of your log (or you can just run |
|
Also, about the extensions: No, I do not have any of those extensions installed. |
@hwsoderlund: Can you try out the new |
No, sorry, it doesn't seem to help. One other thing I should probably mention is that we use |
Thanks for trying it out. Do you mind sharing a complete log with v0.6.0-pre.1, since a lot of things have changed in this release (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs)? Please make sure the log starts with the |
Completely forgot to check this issue again, my apologies. However, I just updated to gopls v0.6.0 and my issue is no longer there! |
Since writing this, I've noticed increasingly high RAM usage while saving files. So, while it doesn't load on every keystroke like it used to, saving files now causes increasingly long freezes of the UI and takes up a ton of RAM. |
Thank you for the update. Are you seeing this when saving |
I am attaching two logs. I hope this is what you are after. If not, please let me know exactly which steps I should take in VS Code during the log capture. Log 1Trace from VS Code startup, with one single go file loaded in the editor. In this file I added a line break, then hit save, then removed the line break and hit save again. The modal displayed, but only briefly. Log 2Trace from forcing the modal to appear and hang. Wrote a long |
Thanks for sharing those--I do see that the requests are taking an unexpectedly long time. And it does seem like you have a lot in the vendor directory--would it be possible for you to temporarily disable vendoring and see if that fixes the issue? It would be good to know if that is the cause. |
Sorry for the late response, I was super busy and then away for most of January. I just updated to Go version 1.5.17 and gopls version 0.6.4 and the issue seems to be gone. Performance is way better and no more reloading of all folders in workspace. |
Shouldn't this be in the gopls/v0.6.4 milestone instead? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, latest go version running on latest gopls (v0.5.4 currently)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a VSCode workspace with various folders from different projects (mix of node & golang projects that interact). On the latest version, a single keystroke will cause intellisense on vscode to be extremely slow as it tries to reload all the packages in every single folder on the workspace (including node ones).
What did you expect to see?
Keystroke to only affect current file I'm working on, not all this overhead.
What did you see instead?
go/packages.load being executed for all the folders in my workspace, including node ones that have no go projects in them.
Details
The text was updated successfully, but these errors were encountered: