Skip to content

DRAFT: Add quick fix to rule82 (multi-fix) #656

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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 <code.rezaei@gmail.com>
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 <code.rezaei@gmail.com>
@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 <XperiAndri@Outlook.com>
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