-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Make keyword recommender know about "replace" #11231
Conversation
@dotnet/roslyn-ide - please review. |
{ | ||
void foo() | ||
{ | ||
foo($$ |
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.
why would it be available here? Isn't it only valid in declarations?
👍 |
|
||
private static bool InMemberDeclarationContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) | ||
{ | ||
return context.IsGlobalStatementContext |
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.
If we don't want to support partial, then i recommend just setting 'canBePartial' to false below.
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.
Fixed that.
"replace" is roughly allowed in the same contexts as "async", so the "replace" ecommender is basically a copy of "async" recommender. Fixes: dotnet#11191
talked to @CyrusNajmabadi offline. He is ok with the last fix. |
"replace" is roughly allowed in the same contexts as "async", so the "replace" recommender is basically a copy of "async" recommender.
Except for expressions contexts where "async" is allowed because of async lambdas, but "replace" is not because there is no such thing as replace lambdas.
Fixes: #11191