-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: gopls doesn't recover easily if initial workspace loading fails #47540
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
This is certainly plausible misbehavior, but did you by any chance have the go.mod file open in your workspace? That could have suppressed any reloading from on-disk changes. I can of course try to reproduce, but thought I'd check this first :) |
I didn't have the When it's not enabled, the initial workspace loading finishes and sends diagnostics about all the missing modules for imports. |
I understand why this issue comes up--I think it's because running |
Rather than adding a special reload workspace quick fix, we should improve the error message and make it clear that the load failed because of a lack of internet (downloading failed). |
Change https://go.dev/cl/419500 mentions this issue: |
Per the explanation at golang/go#54069, allow network access whenever loading the workspace. Enable one test that exercises this behavior. More tests will be added in subsequent CLs. Updates golang/go#47540 Updates golang/go#53676 Updates golang/go#54069 Change-Id: I9c3bb19d36702bc6b8051bee6b7cddaec5b97c0c Reviewed-on: https://go-review.googlesource.com/c/tools/+/419500 Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> gopls-CI: kokoro <noreply+kokoro@google.com>
FWIW this is at least partially resolved by https://go.dev/cl/419500. Now a go mod tidy, or even just We can still do a better job with error messages though. |
What version of Go are you using (
go version
)?What did you do?
Due to bad network connection, initial workspace loading failed to download necessary dependencies.
I manually ran
go mod tidy
and downloaded dependencies, but the error notification didn't go away.How to repro:
go clean -modcache
go mod tidy
manually from the terminalWhat did you expect to see?
go mod tidy
run.What did you see instead?
Sticky error notification & diagnostics.
gopls trace - ran go mod tidy manually around 7:23.
The text was updated successfully, but these errors were encountered: