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 due to quick fixes #65966

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

x/tools/gopls: redundant diagnostics due to quick fixes #65966

findleyr opened this issue Feb 27, 2024 · 1 comment
Labels
gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Refactoring Issues related to refactoring tools Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Member

The following code causes three "too many returns" diagnostics in gopls. Notably, the present but empty result list is required, so this is probably a low priority bug.

func _() () {
  return 0
}

It looks like somehow the "fillreturns" and "noresultvalues" analyzers are colliding, and causing duplication. This may manifest in other ways as we add more quick fixes.

@findleyr findleyr added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Refactoring Issues related to refactoring tools labels Feb 27, 2024
@findleyr findleyr added this to the gopls/v0.16.0 milestone Feb 27, 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 27, 2024
@findleyr findleyr modified the milestones: gopls/v0.16.0, gopls/v0.17.0 May 23, 2024
@findleyr findleyr modified the milestones: gopls/v0.17.0, gopls/v0.18.0 Oct 28, 2024
@findleyr findleyr modified the milestones: gopls/v0.18.0, gopls/v0.19.0 Dec 18, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/650217 mentions this issue: gopls/internal/analysis: simplify type-error analyzers with Cursor

gopherbot pushed a commit to golang/tools that referenced this issue Feb 18, 2025
This CL makes a number of simplifications to the type-error
analyzers:

- Nodes are found using Cursor.FindPos from the error position,
  which is very fast;
- Error position information is read from types.Error instead
  of formatting the ast.File (!) then invoking the dubious
  heuristics of analysisinternal.TypeErrorEndPos, which scans
  the text (!!) assuming well-formattedness (!!!).
- plus various minor cleanups.
- rename typesinternal.ReadGo116ErrorData to ErrorCodeStartEnd.

Updates golang/go#65966
Updates golang/go#71803

Change-Id: Ie4561144040b001b957ef6a3c3631328297d5001
Reviewed-on: https://go-review.googlesource.com/c/tools/+/650217
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
Auto-Submit: Alan Donovan <[email protected]>
Commit-Queue: Alan Donovan <[email protected]>
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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Refactoring Issues related to refactoring tools 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