Skip to content
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: redundant diagnostics for initialization cycle #65877

Open
findleyr opened this issue Feb 22, 2024 · 1 comment
Open

x/tools/gopls: redundant diagnostics for initialization cycle #65877

findleyr opened this issue Feb 22, 2024 · 1 comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

In the following code, gopls produces multiple diagnostics at X:

var X = Y

var Y = Z

var Z = X

This is due to the way gopls unpacks the initialization cycle errors returned by go/types.
Minor, but filing this for tracking purposes. If/when we improve structured errors in go/types, we should fix this. We could also add some ad-hoc suppression of the duplicates.

@findleyr findleyr added this to the gopls/backlog milestone Feb 22, 2024
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Feb 22, 2024
@gopherbot
Copy link

Change https://go.dev/cl/566075 mentions this issue: gopls/internal/test/marker: add a test for initialization cycle errors

gopherbot pushed a commit to golang/tools that referenced this issue Feb 22, 2024
CL 565838 changed the way initialization cycle errors were reporting,
and would have broken gopls' parsing of continuation errors, yet no
x/tools tests failed.

Add a test for this behavior. Due to golang/go#65877, duplicate
diagnostics had to be suppressed for this test.

Updates golang/go#65877

Change-Id: I48244ac469ab78d2e40bf92ec061671cef72c6d9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/566075
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants