-
Notifications
You must be signed in to change notification settings - Fork 18k
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: slow in overlay testdata/ packge #34360
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting section of the gopls Wiki page, and make sure that you have provided all of the relevant information here. |
I am seeing similarly slow behavior during Log from gopls (not same as animation, but editing imports in a different file):
|
@muirrn: By change to the file, do you mean change in the file's imports? That's the only time @tbhartman: What version of |
No, it was happening after any change until I saved the file. I assume the go/packages call is failing so it keeps retrying after every change. |
Do overlays behave like this if you use them in other directories? Is it possibly something specific that's strange about the |
I tried it in a non-testdata directory and it is certainly different. It doesn't get stuck, but no LSP features work and I get |
Do we care about gopls in testdata/ packages? Is it an accident that it works at all, or should it be supported? |
I believe one of the goals of go/packages/packagestest was to have testdata that we could use our own tools on. I know that the I am no longer able to reproduce this, however. I think enough has changed in |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
I created an overlay package (i.e. not saved on disk) in the tools repo, e.g. tools/internal/lsp/testdata/banana/banana.go with contents "package banana".
What did you expect to see?
I expected gopls to work with reasonable responsiveness.
What did you see instead?
Every change to the file triggered a very slow go/packages call. The changes would queue up, so if I typed 10 characters quickly, it would take 30 seconds before gopls caught up. It was hard to save the file because my organizeImports pre-save hook was getting stuck in the queue as well. Here is the log from one keypress:
The text was updated successfully, but these errors were encountered: