quick fix for VariableNotUsed could also delete unused assignment #6143
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
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.
The text was updated successfully, but these errors were encountered: