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

quick fix for VariableNotUsed could also delete unused assignment #6143

Open
thefasquelle opened this issue Aug 23, 2023 · 0 comments
Open
Labels
difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspection-quickfixes up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Milestone

Comments

@thefasquelle
Copy link

Justification
When a variable is unused but gets assigned, it triggers a VariableNotUsed Warnig along with an AssignmentNotUsed Hint.
The quick fix for VariableNotUsed does not delete the assignment, so it generates an UndeclaredVariable Error and we must delete it by hand.

Description
When an AssignmentNotUsed Hint and a VariableNotUsed Warning are targeting the same variable, the quickfix for VariableNotUsed could also delete the assignment. The name of the quick fix would be renamed to "Remove unused declaration and assignment" to be explicit about the whole refactoring. Or it could be added as a second quick fix option but I don't see why someone would actually use the first one anymore.

@thefasquelle thefasquelle added the enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. label Aug 23, 2023
@Vogel612 Vogel612 added difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. feature-inspection-quickfixes up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky labels Dec 23, 2023
@retailcoder retailcoder moved this to To triage in Rubberduck 2.x Mar 21, 2024
@retailcoder retailcoder added this to the 2.x Cycle milestone Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspection-quickfixes up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Projects
Status: To triage
Development

No branches or pull requests

3 participants