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: incorrect edits from the unused variable quickfix #54373

Closed
findleyr opened this issue Aug 10, 2022 · 2 comments
Closed

x/tools/gopls: incorrect edits from the unused variable quickfix #54373

findleyr opened this issue Aug 10, 2022 · 2 comments
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
Member

findleyr commented Aug 10, 2022

Noticed this while preparing for the gopls@v0.9.2 release.

The new unused variable quickfix added in #48975 seems to compute over-large edits in some cases.

For example, given the following function:
image

The quick fix produces the following end-state:
image

I think this needs a bit more work before we enable this quick-fix by default.

CC @rentziass for awareness. This is not a big deal, but I probably won't promote this new feature in the v0.9.2 release notes. We'll promote it for v0.10.0 once we've worked on it a bit more.

@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 Aug 10, 2022
@gopherbot gopherbot added this to the Unreleased milestone Aug 10, 2022
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.10.0 Aug 10, 2022
@findleyr findleyr modified the milestones: gopls/v0.10.0, gopls/later Aug 17, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/640040 mentions this issue: gopls/internal/settings: document why unusedvariable is off

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/640579 mentions this issue: gopls/internal/analysis: unusedvariable

gopherbot pushed a commit to golang/tools that referenced this issue Jan 7, 2025
Updates golang/go#48975
Updates golang/go#54373

Change-Id: I6537ee08ae87e75ce47fdac63f6286048ec666e9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/640040
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.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