Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fade out portion of linq expression that can be simplified#81419

Merged
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
CyrusNajmabadi:simplifyLinq
Nov 24, 2025
Merged

Fade out portion of linq expression that can be simplified#81419
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
CyrusNajmabadi:simplifyLinq

Conversation

@CyrusNajmabadi
Copy link
Contributor

Fixes #62673

context.ReportDiagnostic(Diagnostic.Create(Descriptor, nextInvocation.Syntax.GetLocation()));
// For `Where(x => x is not null).First()` fade out the `First()` portion as we're effectively trimming off
// the last unnecessary chunk.
using var additionalUnnecessaryLocations = TemporaryArray<Location>.Empty;
Copy link
Member

Choose a reason for hiding this comment

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

is it easy to add a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moving to a different test harness, yes :'(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make IDE0120 (simplify LINQ expression) a suggestion by default

3 participants