refactor: migrate prefer_first#286
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the prefer_first lint rule and its quick fix (PreferFirstFix) to the standard analyzer plugin APIs, updating the rule, visitor, and fix implementations, and introducing a reflective test suite. The review feedback highlights two critical issues: first, using thisOrAncestorOfType independently for both MethodInvocation and IndexExpression can lead to incorrect replacements in nested expressions, which can be resolved by using thisOrAncestorMatching; second, calling .first on node.argumentList.arguments can cause analyzer crashes when the argument list is empty, which should be avoided by using firstOrNull.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
aa85631 to
f0acb31
Compare
Closes #278