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: provide a suggested fix for unused variables #48975

Open
findleyr opened this issue Oct 14, 2021 · 5 comments
Open

x/tools/gopls: provide a suggested fix for unused variables #48975

findleyr opened this issue Oct 14, 2021 · 5 comments

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented Oct 14, 2021

As pointed out in #48938, gopls doesn't currently tag unused variables as 'unnecessary', because we compute the 'unnecessary' tag by looking for suggested fixes that are pure deletions. We could change the way we compute the 'unnecessary' tag, but it is approximately the same amount of work to provide a suggested fix.

This is a good issue for an external contributor, as it just involves writing and hooking up an analyzer.

@rentziass
Copy link
Contributor

@rentziass rentziass commented Oct 18, 2021

I can pick this one up, I've just done something very similar with undeclared or I can help someone else get involved?

Loading

@findleyr
Copy link
Contributor Author

@findleyr findleyr commented Oct 18, 2021

CC @stamblerre

Please feel free to pick this one up. I think it should be as simple as finding the enclosing spec/decl and suggesting to delete it (though you'll have to be a bit careful about declarations with more than one spec).

Loading

@Naidile-P-N
Copy link

@Naidile-P-N Naidile-P-N commented Nov 3, 2021

@rentziass I would like to contribute if it's still open

Loading

@rentziass
Copy link
Contributor

@rentziass rentziass commented Nov 3, 2021

@Naidile-P-N I have something sort of ready, I was planning on finishing it this coming weekend :)

Loading

@Naidile-P-N
Copy link

@Naidile-P-N Naidile-P-N commented Nov 3, 2021

@rentziass Oh cool :)

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants