-
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
Simplify fix-all code #73805
Simplify fix-all code #73805
Conversation
/// the <see cref="FixAllState"/> in case that would be useful (for example if the <see | ||
/// cref="IFixAllState.CodeActionEquivalenceKey"/> is used. | ||
/// <para/> | ||
/// Only one of these three overloads needs to be overridden if you want to customize behavior. |
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.
@@ -55,42 +51,24 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) | |||
if (declarationTypeToFix == null) | |||
return; | |||
|
|||
RegisterCodeFix(context, CSharpCodeFixesResources.Declare_as_nullable, GetEquivalenceKey(node, model)); | |||
RegisterCodeFix(context, CSharpCodeFixesResources.Declare_as_nullable, GetEquivalenceKey(node)); |
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.
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.
done.
@@ -108,29 +86,31 @@ static bool IsRemoteApiUsage(SyntaxNode node, SemanticModel model) | |||
foreach (var diagnostic in diagnostics) | |||
{ | |||
var node = diagnostic.Location.FindNode(getInnermostNodeForTie: true, cancellationToken); | |||
MakeDeclarationNullable(editor, model, node, alreadyHandled, cancellationToken); | |||
await MakeDeclarationNullableAsync( | |||
document, model, editor, node, alreadyHandled, cancellationToken).ConfigureAwait(false); |
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.
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.
true. but i'm ok here deferring that until we have some traces indicating benefit :)
No need for a fix-all provider to force creating a semantic model (which also creates compilations/SG docs) if it doesn't need it.