- Notifications
You must be signed in to change notification settings - Fork481
Add CollectionExpression support to CA1870 (UseSearchValues)#7252
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
MihaZupan commentedMar 19, 2024
cc:@stephentoub |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #7252 +/- ##========================================= Coverage 96.47% 96.47% ========================================= Files 1436 1440 +4 Lines 342881 344487 +1606 Branches 11292 11340 +48 =========================================+ Hits 330797 332356 +1559- Misses 9230 9262 +32- Partials 2854 2869 +15 |
MihaZupan commentedApr 3, 2024
@dotnet/roslyn-analysis who would be the right person to review this one? |
buyaa-n left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM, I will let@CyrusNajmabadi take another look
CyrusNajmabadi left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks reasonable to me :-)
Followup after#6898 to add recognition for collection expression patterns as well.
Currently, if you write something like
you will be offered two fixers: one to replace
s_charswithSearchValues.Create("aeiouA"), and the other to replace the array creation with['a', 'e', 'i', 'o', 'u', 'A'].If you accept the latter, you won't be offered the
SearchValuesfixer anymore since we don't recognize the pattern.This PR adds recognition for patterns like