-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Initial support for a set of analyzers/fixers to update existing code to use collection expressions. #69118
Initial support for a set of analyzers/fixers to update existing code to use collection expressions. #69118
Conversation
…mabadi/roslyn into useCollectionExpression
}); | ||
} | ||
|
||
private static bool IsInTargetTypedLocation(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) |
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.
Will this suffer from many semantic model calls? I think the syntactic filteration would still have many applicable nodes, and hence many semantic model calls.
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.
Not sure what thsi question means.
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.
I mean, does this make too many semantic model caĺls that could affect performance?
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.
I don't see anything that would cause too many semantic model calls here. We effectively are doing a check right on the item of interest.
Example of results here: #69189 |
@dotnet/roslyn-ide ptal :) |
@dotnet/roslyn-ide ptal. |
} | ||
|
||
[Fact] | ||
public async Task TestTargetTypedInConditional4() |
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.
public async Task TestTargetTypedInConditional4() | |
public async Task TestTargetTypedMissingInConditional4() |
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.
sure. can update that name in followup :)
Part of the work for: #69132
So i'm breaking things into pieces to make it easier to review.
This PR is specifically about handling
new X[] { a, b, c }
ornew[] { a, b, c }
orX[] v = { a, b, c }
and offering to convert to[a, b, c]
in those cases.