Skip to content

Conversation

@webwarrior-ws
Copy link
Contributor

Implement quick fix for UsedUnderscorePrefixedElements rule.
It renames identifier with _ prefix to identifier without this prefix (e.g. _foo -> foo).
Quick fix is only applied if no other identifiers with suggested name (without underscore) exist.
There are cases when such identifiers exist, but not in the same scope, and still no quick fix is applied. That is because checking the scope proved to be much more difficult than expected.

@knocte knocte changed the title Add quick fix to rule82 Add quick fix to rule82 (multi-fix) Jan 10, 2024
@knocte knocte changed the title Add quick fix to rule82 (multi-fix) DRAFT: Add quick fix to rule82 (multi-fix) Jan 10, 2024
Copy link
Collaborator

@xperiandri xperiandri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer such syntax, otherwise good

webwarrior-ws and others added 3 commits July 7, 2025 02:18
Added tests for suggested quick fix for
UsedUnderscorePrefixedElements rule.
Implement quick fix for UsedUnderscorePrefixedElements. Quick
fix is only applied if no other identifiers with suggested name
(without underscore) exist. There are cases when such
identifiers exist, but not in the same scope, and stil no quick
fix is applied.

Co-authored-by: Mehrshad <[email protected]>
Make ApplyQuickFix method apply all fixes and not only first
one. It's necessary when testing rules that can create more
than one suggested fix.

Co-authored-by: Mehrshad <[email protected]>
@xperiandri xperiandri force-pushed the addQuickFixToRule82 branch from bb881c2 to 00c5b02 Compare July 6, 2025 22:18
Regarding code style

Co-authored-by: Andrii Chebukin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants