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
x/tools/gopls: bad performance with multiple workspace folders #40295
Comments
It looks like you may opening a directory that More verbose logs would be helpful here - details on how to capture them here. |
Thanks @stamblerre feel free to close this, i just clicked the "report" button and let it do its thing. For the record, i have a large code base that looks kinda like this:
I have a single VSCode project open to the root of I wonder if there is a superior way to have my multi-language project open in a single VS code window (so i can easily |
Does the If you can share the more details logs (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs), I'll probably be able to identify the issue a bit quicker. |
yes the The list i posted above are not the actual names, i renamed them for ease of conversation, but it seems like
Here are the gopls (server) logs:
EDIT: looks like i do have a GOPATH at |
Don't worry about that - it's the default value, and it's having no effect if you're using modules. I wonder if the high CPU usage is caused by the fact that you have a multiple workspaces. Does |
Yes @stamblerre it does seem like closing out my multi-workspace-folder VSCode instance, and instead opening just the directory that contains my golang source code (in my case This is not a great solution for me, because it means that I have to have at least two windows open:
I think an ideal fix would be to explicitly enable or disable golang/gopls within each directory. That way i could have my one-giant-workspace, but gopls would only be enabled for the one golang directory and not the parent. |
Glad to hear it's working better. I agree it's not an ideal solution, and our plan is to address this shortcoming of |
Closing this, as it will be addressed with the more fundamental shifts in v1.0. |
Describe what you observed.
GPLS uses 200% of my CPU (both cores) indefinitely whenever I rebuild my golang in my terminal. The only way to make my computer responsive again is to force-quit gopls. Importantly, the usability of gopls (go-to-definition in VSCode for example) is broken until I force-quit the process enough times such that the CPU goes down. Only then does it actually work.
Please attach the stack trace from the crash.
A window with the error message should have popped up in the lower half of your screen.
Please copy the stack trace from that window and paste it in this issue.
The text was updated successfully, but these errors were encountered: