480 references to Document
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
66return cancellationToken => FixAllAsync(context.Document, diagnostics, cancellationToken);
ILLink.CodeFixProvider (21)
BaseAttributeCodeFixProvider.cs (1)
35var document = context.Document;
DynamicallyAccessedMembersCodeFixProvider.cs (1)
95var document = context.Document;
MatchPartialSafetyModifierCodeFixProvider.cs (4)
54if (await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false) is not { } root 55|| await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false) is not { } semanticModel) 72? await GetDeclarationToEditAsync(context.Document.Project.Solution, otherPart, modifier, context.CancellationToken).ConfigureAwait(false) 73: (context.Document, declaration);
RemoveInvalidUnsafeCodeFixProvider.cs (4)
44var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 66context.Document, 77|| await GetPartsWithUnsafeModifierAsync(context.Document, declaration, context.CancellationToken).ConfigureAwait(false) is not { Length: > 0 } parts) 86context.Document.Project.Solution,
RemoveUndocumentedUnsafeCodeFixProvider.cs (2)
47var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 66context.Document,
RequiresUnsafeCodeFixProvider.cs (1)
34var document = context.Document;
SynchronizeUnsafeContractCodeFixProvider.cs (6)
76if (await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false) is not { } root) 95context.Document, 108context.Document, 115if (await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false) is not { } semanticModel 126if (GetEditableDeclarations(baseSymbol, context.Document.Project.Solution, context.CancellationToken) is not { Count: > 0 } declarations 141cancellationToken => AddUnsafeToBaseAsync(context.Document.Project.Solution, baseDeclarations, cancellationToken),
UnsafeModifierCodeFixHelpers.cs (2)
38var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 71cancellationToken => AddModifierAsync(context.Document, declaration, modifier, cancellationToken),
Microsoft.Analyzers.Extra (4)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
58var (invocationExpression, details) = await CheckIfCanFixAsync(context.Document, context.Span, context.CancellationToken).ConfigureAwait(false); 64createChangedSolution: cancellationToken => ApplyFixAsync(context.Document, invocationExpression, details, cancellationToken),
MakeExeTypesInternalFixer.cs (2)
28var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 32var action = CodeAction.Create(Resources.MakeTypeInternal, c => MakeInternalAsync(context.Document, node, context.CancellationToken), nameof(MakeExeTypesInternalFixer));
Microsoft.AspNetCore.App.CodeFixes (28)
Authorization\AddAuthorizationBuilderFixer.cs (3)
29var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 35var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 48cancellationToken => ReplaceWithAddAuthorizationBuilder(diagnostic, root, context.Document, invocation),
Dependencies\AddPackageFixer.cs (3)
31var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 37var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 90context.Document,
DetectMismatchedParameterOptionalityFixer.cs (1)
29cancellationToken => FixMismatchedParameterOptionalityAsync(diagnostic, context.Document, cancellationToken),
Http\HeaderDictionaryAddFixer.cs (4)
30var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 36var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 51cancellationToken => ReplaceWithAppend(diagnostic, wellKnownTypes, root, context.Document, invocation), 61cancellationToken => ReplaceWithIndexer(diagnostic, root, context.Document, assignment),
Http\HeaderDictionaryIndexerFixer.cs (1)
33cancellationToken => FixHeaderDictionaryIndexer(diagnostic, context.Document, resolvedPropertyName!, cancellationToken),
Kestrel\ListenOnIPv6AnyFixer.cs (7)
33var editor = await DocumentEditor.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false); 34var root = await context.Document.GetSyntaxRootAsync(cancellationToken); 37return context.Document; 43return context.Document; 49return context.Document; 53return context.Document; 60return context.Document;
PublicPartialProgramClassFixer.cs (4)
31var editor = await DocumentEditor.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false); 32var root = await context.Document.GetSyntaxRootAsync(cancellationToken); 35return context.Document; 42return context.Document;
RouteParameterUnusedParameterFixer.cs (3)
31var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 37var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 51cancellationToken => AddRouteParameterAsync(diagnostic, root, routeUsageCache, context.Document, cancellationToken),
WebApplicationBuilderFixer.cs (2)
31var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 70cancellationToken => FixWebApplicationBuilderAsync(diagnostic, root, context.Document, invocation),
Microsoft.AspNetCore.Components.Analyzers (7)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
33var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 45createChangedDocument: c => GetTransformedDocumentAsync(context.Document, root, declaration),
JSInteropCodeFixProvider.cs (2)
33var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 68createChangedDocument: cancellationToken => TryCatchWrapJSInteropCallAsync(context.Document, root, expressionStatement, cancellationToken),
JSInvokableCodeFixProvider.cs (1)
39createChangedDocument: ct => GetTransformedDocumentAsync(diagnostic, context.Document, ct),
StateHasChangedCodeFixProvider.cs (2)
31var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 55createChangedDocument: cancellationToken => RemoveStateHasChangedCallAsync(context.Document, root, invocation, cancellationToken),
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
33var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 45createChangedDocument: c => GetTransformedDocumentAsync(context.Document, root, declaration),
Microsoft.CodeAnalysis.Analyzers (20)
FixAnalyzers\FixerWithFixAllAnalyzer.Fixer.cs (3)
38var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 45var generator = SyntaxGenerator.GetGenerator(context.Document); 54context.RegisterCodeFix(CodeAction.Create(title, c => AddMethodAsync(context.Document, classDecl, c), equivalenceKey: title), context.Diagnostics);
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (4)
60cancellationToken => AddEntryToUnshippedFileAsync(context.Document.Project, entryToAdd, cancellationToken), 71cancellationToken => AddEntryToUnshippedFileAsync(context.Document.Project, entryToAdd, cancellationToken), 78cancellationToken => UpdateEntryInUnshippedFileAsync(context.Document.Project, ruleId, entryToUpdate, cancellationToken), 87cancellationToken => AddAnalyzerReleaseTrackingFilesAsync(context.Document.Project),
MetaAnalyzers\Fixers\ApplyDiagnosticAnalyzerAttributeFix.cs (3)
22var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 29var generator = SyntaxGenerator.GetGenerator(context.Document); 57c => GetFixAsync(context.Document, root, classDecl, generator, languages),
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (2)
46cancellationToken => ConvertToEqualsAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken), 54cancellationToken => CallOverloadWithEqualityComparerAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken),
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (1)
35cancellationToken => ConfigureGeneratedCodeAnalysisAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken),
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (4)
41var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 48var additionalDocuments = context.Document.Project.AdditionalDocuments.ToImmutableArray(); 49var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 71ct => ApplyFixAsync(context.Document, root, fixInfo.Value, ct),
MetaAnalyzers\Fixers\EnableConcurrentExecutionFix.cs (1)
34cancellationToken => EnableConcurrentExecutionAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken),
MetaAnalyzers\Fixers\PreferIsKindFix.cs (1)
29cancellationToken => ConvertKindToIsKindAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
66return cancellationToken => FixAllAsync(context.Document, diagnostics, cancellationToken);
Microsoft.CodeAnalysis.CodeStyle.Fixes (49)
src\roslyn\src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
34var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
67var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
35var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
67var document = context.Document; 244var codeFixData = PrepareCreationOfCodeActions(context.Document, arguments, methodsAndArgumentsToAdd);
src\roslyn\src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
72var document = context.Document; 268var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
23var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 30node, context.Document, context.Diagnostics[0], context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
31var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 43cancellationToken => AddParamTagAsync(context.Document, parentMethod, docCommentNode, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 42cancellationToken => RemoveDuplicateParamTagAsync(context.Document, paramNode, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
37cancellationToken => GetTransformedDocumentAsync(context.Document, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (4)
70var root = await context.Document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 71var text = await context.Document.GetValueTextAsync(cancellationToken).ConfigureAwait(false); 80var formattingOptions = await context.Document.GetSyntaxFormattingOptionsAsync(cancellationToken).ConfigureAwait(false); 83return context.Document.WithSyntaxRoot(formattedRoot);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
23var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (3)
32if (context.Document.Project.IsSubmission) 38var document = context.Document; 45var codeActions = await GetCodeActionsAsync(context.Document, name, context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
26var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
20var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (2)
21var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 28var codeAction = await GetCodeFixAsync(root, node, context.Document, diagnostic, context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
44var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
41cancellationToken => FixNodeAsync(context.Document, node, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 33cancellationToken => FixAllInDocumentAsync(context.Document, context.Diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
54var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
34var syntaxTree = await context.Document.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
59var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
29var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
36cancellationToken => RemoveUnnecessaryImportsAsync(context.Document, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
28var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
32var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 33var syntaxFacts = context.Document.GetRequiredLanguageService<ISyntaxFactsService>();
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
154if (IsForEachIterationVariableDiagnostic(diagnostic, context.Document, context.CancellationToken)) 163var syntaxFacts = context.Document.GetRequiredLanguageService<ISyntaxFactsService>(); 164var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
29var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
42var project = context.Document.Project;
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
85var solution = context.Document.Project.Solution;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
66return cancellationToken => FixAllAsync(context.Document, diagnostics, cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (40)
src\cef93d2425d77fca\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 44c => GetChangedDocumentAsync(context.Document, conditionalExpression.SpanStart, c),
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (2)
38var document = context.Document; 42var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
39var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
38var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (2)
34if (context.Document.Project.IsSubmission) 39var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (2)
45var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 53cancellationToken => GetChangedDocumentAsync(context.Document, originalNode, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
36context.Document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
33var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
37var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
59var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
33var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
35var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
49context.Document, model: null, node, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
35var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (2)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 49cancellationToken => FixAsync(context.Document, argumentSyntax, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (3)
33var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 44var generator = context.Document.GetRequiredLanguageService<SyntaxGenerator>(); 51ct => FixAsync(context.Document, generator, memberDeclarationSyntax, ct),
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
34cancellationToken => FixAllAsync(context.Document, context.Diagnostics, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (1)
35cancellationToken => FixSingleDocumentAsync(context.Document, context.Diagnostics, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (4)
40var syntaxRoot = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 47var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 50context.Document, semanticModel, defaultLiteral, context.CancellationToken); 57c => ReplaceAsync(context.Document, context.Span, newExpression, c),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
34async _ => AllowUnsafeOnProject(context.Document.Project)), context.Diagnostics);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
102var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
36var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
59var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
43var document = context.Document;
Microsoft.CodeAnalysis.CSharp.Features (44)
ConvertProgram\ConvertToProgramMainCodeFixProvider.cs (1)
34var document = context.Document;
ConvertProgram\ConvertToTopLevelStatementsCodeFixProvider.cs (1)
33var document = context.Document;
Copilot\CSharpCopilotCodeFixProvider.cs (1)
54var document = context.Document;
Copilot\CSharpImplementNotImplementedExceptionFixProvider.cs (1)
42var document = context.Document;
src\cef93d2425d77fca\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 44c => GetChangedDocumentAsync(context.Document, conditionalExpression.SpanStart, c),
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (2)
38var document = context.Document; 42var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
39var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
38var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (2)
34if (context.Document.Project.IsSubmission) 39var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (2)
45var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 53cancellationToken => GetChangedDocumentAsync(context.Document, originalNode, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
36context.Document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
33var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
37var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
59var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
33var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
35var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
49context.Document, model: null, node, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
35var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (2)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 49cancellationToken => FixAsync(context.Document, argumentSyntax, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (3)
33var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 44var generator = context.Document.GetRequiredLanguageService<SyntaxGenerator>(); 51ct => FixAsync(context.Document, generator, memberDeclarationSyntax, ct),
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
34cancellationToken => FixAllAsync(context.Document, context.Diagnostics, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (1)
35cancellationToken => FixSingleDocumentAsync(context.Document, context.Diagnostics, cancellationToken),
src\roslyn\src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (4)
40var syntaxRoot = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 47var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 50context.Document, semanticModel, defaultLiteral, context.CancellationToken); 57c => ReplaceAsync(context.Document, context.Span, newExpression, c),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
34async _ => AllowUnsafeOnProject(context.Document.Project)), context.Diagnostics);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
102var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
36var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
59var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
43var document = context.Document;
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (12)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CSharpStaticHolderTypes.Fixer.cs (1)
29SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpAvoidDuplicateElementInitializationFixer.cs (2)
38var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 48_ => Task.FromResult(RemoveElementInitializer(elementInitializer, objectInitializer, root, context.Document)),
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (3)
32if (context.Document.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false }) 38SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 49async ct => await UseDisabledMarshallingEquivalentAsync(enclosingNode, context.Document, context.CancellationToken).ConfigureAwait(false),
Microsoft.NetCore.Analyzers\Performance\CSharpCollapseMultiplePathOperations.Fixer.cs (1)
26var document = context.Document;
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (1)
35Document document = context.Document;
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (1)
51Document doc = context.Document;
Microsoft.NetCore.Analyzers\Usage\CSharpMissingShebangInFileBasedProgram.Fixer.cs (3)
20var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 30var options = await context.Document.GetOptionsAsync(ct).ConfigureAwait(false); 37return context.Document.WithSyntaxRoot(newRoot);
Microsoft.CodeAnalysis.Features (60)
AddImport\AbstractAddImportCodeFixProvider.cs (1)
52var document = context.Document;
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (2)
50context.Document.Project, identity, context.CancellationToken).ConfigureAwait(false); 60var compilation = await context.Document.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
32var document = context.Document;
CodeFixes\Suppression\WrapperCodeFixProvider.cs (2)
29var suppressionFixes = await SuppressionFixProvider.GetFixesAsync(context.Document, context.Span, documentDiagnostics, context.CancellationToken).ConfigureAwait(false); 36var suppressionFixes = await SuppressionFixProvider.GetFixesAsync(context.Document.Project, projectDiagnostics, context.CancellationToken).ConfigureAwait(false);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
25var document = context.Document;
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
43var document = context.Document;
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (1)
72var document = context.Document;
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (3)
39var document = context.Document; 110var document = context.Document; 149var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
34var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
67var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
35var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
67var document = context.Document; 244var codeFixData = PrepareCreationOfCodeActions(context.Document, arguments, methodsAndArgumentsToAdd);
src\roslyn\src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
72var document = context.Document; 268var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
23var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 30node, context.Document, context.Diagnostics[0], context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
31var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 43cancellationToken => AddParamTagAsync(context.Document, parentMethod, docCommentNode, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
35var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 42cancellationToken => RemoveDuplicateParamTagAsync(context.Document, paramNode, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
37cancellationToken => GetTransformedDocumentAsync(context.Document, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (4)
70var root = await context.Document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 71var text = await context.Document.GetValueTextAsync(cancellationToken).ConfigureAwait(false); 80var formattingOptions = await context.Document.GetSyntaxFormattingOptionsAsync(cancellationToken).ConfigureAwait(false); 83return context.Document.WithSyntaxRoot(formattedRoot);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
23var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (3)
32if (context.Document.Project.IsSubmission) 38var document = context.Document; 45var codeActions = await GetCodeActionsAsync(context.Document, name, context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
26var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
20var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (2)
21var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 28var codeAction = await GetCodeFixAsync(root, node, context.Document, diagnostic, context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
44var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
41cancellationToken => FixNodeAsync(context.Document, node, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 33cancellationToken => FixAllInDocumentAsync(context.Document, context.Diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
54var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
34var syntaxTree = await context.Document.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
59var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
29var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
36cancellationToken => RemoveUnnecessaryImportsAsync(context.Document, cancellationToken),
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
28var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
32var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 33var syntaxFacts = context.Document.GetRequiredLanguageService<ISyntaxFactsService>();
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
154if (IsForEachIterationVariableDiagnostic(diagnostic, context.Document, context.CancellationToken)) 163var syntaxFacts = context.Document.GetRequiredLanguageService<ISyntaxFactsService>(); 164var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
29var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
42var project = context.Document.Project;
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
85var solution = context.Document.Project.Solution;
Microsoft.CodeAnalysis.NetAnalyzers (131)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DefineAccessorsForAttributeArguments.Fixer.cs (1)
34Document document = context.Document;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotDirectlyAwaitATask.Fixer.cs (3)
30SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 38async ct => await GetFixAsync(context.Document, expression, argument: false, cancellationToken: ct).ConfigureAwait(false), 45async ct => await GetFixAsync(context.Document, expression, argument: true, cancellationToken: ct).ConfigureAwait(false),
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumsShouldHaveZeroValue.Fixer.cs (5)
27SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 37SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 55async ct => await GetUpdatedDocumentForRuleNameRenameAsync(context.Document, (IFieldSymbol)declaredSymbol, context.CancellationToken).ConfigureAwait(false), 62async ct => await ApplyRuleNameMultipleZeroAsync(context.Document, (INamedTypeSymbol)declaredSymbol, context.CancellationToken).ConfigureAwait(false), 70async ct => await ApplyRuleNameNoZeroValueAsync(context.Document, (INamedTypeSymbol)declaredSymbol, context.CancellationToken).ConfigureAwait(false),
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumWithFlagsAttribute.Fixer.cs (2)
30SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 42ct => SyntaxEditorFixAllProvider.ApplyFixesAsync(context.Document, ImmutableArray.Create(diagnostic), ApplyFixAsync, ct),
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EquatableAnalyzer.Fixer.cs (4)
39SyntaxGenerator generator = SyntaxGenerator.GetGenerator(context.Document); 40SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 50await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 62Document document = context.Document;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldNotContainUnderscores.Fixer.cs (3)
34var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 35var model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 63ct => Renamer.RenameSymbolAsync(context.Document.Project.Solution, symbol, new SymbolRenameOptions(), newName, ct),
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\InterfaceMethodsShouldBeCallableByChildTypes.Fixer.cs (6)
35SemanticModel semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 36SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 48SyntaxGenerator generator = SyntaxGenerator.GetGenerator(context.Document); 79async ct => await MakeProtectedAsync(context.Document, symbolToChange, checkSetter, ct).ConfigureAwait(false), 92async ct => await ChangeToPublicInterfaceImplementationAsync(context.Document, symbolToChange, ct).ConfigureAwait(false), 99async ct => await MakeContainingTypeSealedAsync(context.Document, methodSymbol, ct).ConfigureAwait(false),
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\MarkAttributesWithAttributeUsage.Fixer.cs (2)
38var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 45var document = context.Document;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsAndOperatorEqualsOnValueTypes.Fixer.cs (1)
35Document document = context.Document;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideMethodsOnComparableTypes.Fixer.cs (1)
25if (await GetTypeToFixAsync(context.Document, context.Span, context.CancellationToken).ConfigureAwait(false) is null)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ParameterNamesShouldMatchBaseDeclaration.Fixer.cs (3)
35SyntaxNode syntaxRoot = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 36SemanticModel semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 52cancellationToken => GetUpdatedDocumentForParameterRenameAsync(context.Document, declaredSymbol, newName, cancellationToken),
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\TypesThatOwnDisposableFieldsShouldBeDisposable.Fixer.cs (2)
28SyntaxGenerator generator = SyntaxGenerator.GetGenerator(context.Document); 29SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\UriParametersShouldNotBeStrings.Fixer.cs (1)
43Document document = context.Document;
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidLengthCalculationWhenSlicingToEnd.Fixer.cs (2)
29var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 30var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\Maintainability\UseNameofInPlaceOfString.Fixer.cs (1)
26var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\MarkMembersAsStatic.Fixer.cs (2)
44var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 54ct => MakeStaticAsync(context.Document, root, node, ct),
Microsoft.CodeQuality.Analyzers\QualityGuidelines\RethrowToPreserveStackDetails.Fixer.cs (1)
27var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\SealMethodsThatSatisfyPrivateInterfaces.Fixer.cs (3)
32var model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 33var gen = SyntaxGenerator.GetGenerator(context.Document); 43var solution = context.Document.Project.Solution;
Microsoft.CodeQuality.Analyzers\QualityGuidelines\UseLiteralsWhereAppropriate.Fixer.cs (2)
25SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 28declaration = SyntaxGenerator.GetGenerator(context.Document).GetDeclaration(declaration, DeclarationKind.Field);
Microsoft.NetCore.Analyzers\ImmutableCollections\DoNotCallToImmutableCollectionOnAnImmutableCollectionValue.Fixer.cs (1)
39var document = context.Document;
Microsoft.NetCore.Analyzers\InteropServices\DynamicInterfaceCastableImplementation.Fixer.cs (3)
28SyntaxGenerator generator = SyntaxGenerator.GetGenerator(context.Document); 29SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 46Document document = context.Document;
Microsoft.NetCore.Analyzers\InteropServices\SpecifyMarshalingForPInvokeStringArguments.Fixer.cs (2)
27SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 34SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\DoNotGuardCall.Fixer.cs (1)
28SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\DoNotUseCountWhenAnyCanBeUsed.Fixer.cs (2)
58var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 67var document = context.Document;
Microsoft.NetCore.Analyzers\Performance\PreferConvertToHexStringOverBitConverter.Fixer.cs (2)
45var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 46var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\PreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (1)
44Document document = context.Document;
Microsoft.NetCore.Analyzers\Performance\PreferHashDataOverComputeHash.Fixer.cs (3)
28var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 41var codeActionChain = new HashDataCodeAction(context.Document, hashInstanceTarget, Helper, root); 48var codeAction = new HashDataCodeAction(context.Document, hashInstanceTarget, Helper, root);
Microsoft.NetCore.Analyzers\Performance\PreferIsEmptyOverCount.Fixer.cs (1)
24SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\PreferLengthCountIsEmptyOverAny.Fixer.cs (2)
37SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 52DocumentEditor editor = await DocumentEditor.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\PreferReadOnlySpanOverSpan.Fixer.cs (3)
46var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 48var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 58createChangedDocument: c => ChangeParameterTypeAsync(context.Document, node, c),
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Fixer.cs (1)
42Document doc = context.Document;
Microsoft.NetCore.Analyzers\Performance\UseAsSpanInsteadOfRangeIndexer.Fixer.cs (2)
49var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 73var editor = await DocumentEditor.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UsePropertyInsteadOfCountMethodWhenAvailable.Fixer.cs (1)
39var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.Fixer.cs (1)
49Document document = context.Document;
Microsoft.NetCore.Analyzers\Performance\UseSpanClearInsteadOfFIll.Fixer.cs (1)
25var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UseStringContainsCharOverloadWithSingleCharacters.Fixer.cs (1)
22var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (2)
25var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 28var model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\AvoidConstArrays.Fixer.cs (1)
41Document document = context.Document;
Microsoft.NetCore.Analyzers\Runtime\AvoidUnreliableStreamRead.Fixer.cs (2)
37var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 38var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.Fixer.cs (3)
47var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 54var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 79ct => UseCollectionDirectlyAsync(context.Document, root, invocationNode, collectionSyntax, method),
Microsoft.NetCore.Analyzers\Runtime\ForwardCancellationTokenToInvocations.Fixer.cs (1)
51Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\InstantiateArgumentExceptionsCorrectly.Fixer.cs (3)
38SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 39SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 53ct => SyntaxEditorFixAllProvider.ApplyFixesAsync(context.Document, context.Diagnostics,
Microsoft.NetCore.Analyzers\Runtime\MarkAllNonSerializableFields.Fixer.cs (4)
28SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 38async ct => await AddNonSerializedAttributeAsync(context.Document, fieldNode, ct).ConfigureAwait(false), 43SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 49async ct => await AddSerializableAttributeToTypeAsync(context.Document, type, ct).ConfigureAwait(false),
Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstring.Fixer.cs (1)
33var document = context.Document;
Microsoft.NetCore.Analyzers\Runtime\PreferConstCharOverConstUnitString.Fixer.cs (1)
35Document document = context.Document;
Microsoft.NetCore.Analyzers\Runtime\PreferDictionaryContainsMethods.Fixer.cs (2)
32SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 39Document document = context.Document;
Microsoft.NetCore.Analyzers\Runtime\PreferJsonElementParse.Fixer.cs (1)
30Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\PreferStreamAsyncMemoryOverloads.Fixer.cs (1)
61Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\PreferStringContainsOverIndexOf.Fixer.cs (1)
26Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\PreferTypedStringBuilderAppendOverloads.Fixer.cs (1)
35Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\SealInternalTypes.Fixer.cs (1)
32var solutionEditor = new SolutionEditor(context.Document.Project.Solution);
Microsoft.NetCore.Analyzers\Runtime\SpecifyCultureForToLowerAndToUpper.Fixer.cs (2)
30SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 37Document document = context.Document;
Microsoft.NetCore.Analyzers\Runtime\TestForEmptyStringsUsingStringLength.Fixer.cs (3)
35SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 45SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 58Document document = context.Document;
Microsoft.NetCore.Analyzers\Runtime\TestForNaNCorrectly.Fixer.cs (2)
25SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 26SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseCancellationTokenThrowIfCancellationRequested.Fixer.cs (4)
33SemanticModel model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 36SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 60var editor = await DocumentEditor.CreateAsync(context.Document, token).ConfigureAwait(false); 87var editor = await DocumentEditor.CreateAsync(context.Document, token).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseEnvironmentMembersFixer.cs (1)
39Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\UseExceptionThrowHelpersFixer.cs (1)
31Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\UseOrdinalStringComparison.Fixer.cs (2)
23SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 25if (!await CanFixAsync(context.Document, root.FindNode(context.Span), context.CancellationToken).ConfigureAwait(false))
Microsoft.NetCore.Analyzers\Runtime\UseRegexMembersFixer.cs (1)
40Document doc = context.Document;
Microsoft.NetCore.Analyzers\Runtime\UseSpanBasedStringConcat.Fixer.cs (2)
38var model = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 39var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseStringEqualsOverStringCompare.Fixer.cs (2)
32var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 33var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Tasks\DoNotCreateTaskCompletionSourceWithWrongArguments.Fixer.cs (1)
28Document doc = context.Document;
Microsoft.NetCore.Analyzers\Tasks\DoNotUseWhenAllOrWaitAllWithSingleArgumentFixer.cs (4)
26var root = await context.Document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 33var semanticModel = await context.Document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 45var editor = await DocumentEditor.CreateAsync(context.Document, ct).ConfigureAwait(false); 65var editor = await DocumentEditor.CreateAsync(context.Document, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Usage\DoNotPassNonNullableValueToArgumentNullExceptionThrowIfNull.Fixer.cs (2)
40SyntaxNode root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 47Document document = context.Document;
Microsoft.NetCore.Analyzers\Usage\PreferGenericOverloads.Fixer.cs (3)
30var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 38var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 48ct => ReplaceWithGenericCallAsync(context.Document, invocation, ct),
Microsoft.NetCore.Analyzers\Usage\UseVolatileReadWrite.Fixer.cs (2)
31var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 32var semanticModel = await context.Document.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
SyntaxEditorBasedCodeFixProvider.cs (1)
39Document document = context.Document;
Microsoft.CodeAnalysis.VisualBasic.Features (16)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.vb (2)
37Dim root = Await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False) 66context.RegisterCodeFix(New CorrectNextControlVariableCodeAction(context.Document, nodeToReplace, newNode), context.Diagnostics)
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (4)
65Dim root = Await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False) 87Function(c) GeneratePropertyEndConstructAsync(context.Document, DirectCast(endStatement.Parent, PropertyBlockSyntax), c), 98Function(c) GeneratePropertyEndConstructAsync(context.Document, DirectCast(endStatement.Parent.Parent, PropertyBlockSyntax), c), 109Function(c) GenerateEndConstructAsync(context.Document, endStatement, c),
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (4)
45Dim root = Await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False) 56result = Await GenerateEventFromImplementsAsync(context.Document, qualifiedName, context.CancellationToken).ConfigureAwait(False) 61result = Await GenerateEventFromHandlesAsync(context.Document, handlesClauseItem, context.CancellationToken).ConfigureAwait(False) 66result = Await GenerateEventFromAddRemoveHandlerAsync(context.Document, handlerStatement, context.CancellationToken).ConfigureAwait(False)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (1)
59Dim document = context.Document
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (1)
42Dim document = context.Document
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (1)
45Dim document = context.Document
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.vb (3)
35Dim root = Await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False) 47context.RegisterCodeFix(New AddKeywordAction(context.Document, token.Parent, VBFeaturesResources.Add_Overloads, SyntaxKind.OverloadsKeyword), context.Diagnostics) 49context.RegisterCodeFix(New AddKeywordAction(context.Document, token.Parent, VBFeaturesResources.Add_Shadows, SyntaxKind.ShadowsKeyword), context.Diagnostics)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (1)
24Dim document = context.Document
Microsoft.CodeAnalysis.Workspaces (3)
CodeFixes\CodeFixContext.cs (2)
45/// This property should be used instead of <see cref="Document"/> property by 52/// Text span within the <see cref="Document"/> or <see cref="TextDocument"/> to fix.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
66return cancellationToken => FixAllAsync(context.Document, diagnostics, cancellationToken);
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\AddMarshalAsToElementFixer.cs (1)
25Document doc = context.Document;
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
119Document doc = context.Document;
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
39ct => AddDisableRuntimeMarshallingAttributeApplicationToProject(context.Document.Project, ct),
Analyzers\CustomMarshallerAttributeFixer.cs (1)
111Document doc = context.Document;
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
119Document doc = context.Document;
Microsoft.ML.InternalCodeAnalyzer (11)
ContractsCheckNameofFixProvider.cs (7)
39var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 65c => StringReplaceAsync(context.Document, nameArgValue, nameArg, c), Id), diagnostic); 102c => ExpressionReplaceAsync(context.Document, bestSymbol, nameArg, c), Id), diagnostic); 121c => StringReplaceAsync(context.Document, nameArgValue, nameArg, c), Id), diagnostic); 133var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken); 149c => StringReplaceAsync(context.Document, argName + "." + s.Name, nameArg, c), Id), diagnostic); 159c => StringReplaceAsync(context.Document, argName + "." + s.Name, nameArg, c), Id), diagnostic);
NameFixProvider.cs (4)
59var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken); 64string docName = context.Document.Name; 66&& context.Document.Name.StartsWith(originalName, StringComparison.OrdinalIgnoreCase)) 99c => RenameAsync(context.Document, token.Parent, originalName, renamer, c), diagnostic.Id), diagnostic);
Roslyn.Diagnostics.Analyzers (11)
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (3)
50createChangedDocument = cancellationToken => AddExplicitImportingConstructorAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken); 55createChangedDocument = cancellationToken => MakeConstructorPublicAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken); 60createChangedDocument = cancellationToken => AddImportingConstructorAttributeAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken);
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (5)
47createChangedDocument = cancellationToken => AddObsoleteAttributeAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken); 52createChangedDocument = cancellationToken => AddDescriptionAndErrorAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken); 57createChangedDocument = cancellationToken => UpdateDescriptionAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken); 62createChangedDocument = cancellationToken => AddErrorAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken); 67createChangedDocument = cancellationToken => SetErrorToTrueAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken);
PartsExportedWithMEFv2MustBeMarkedAsShared.Fixer.cs (1)
32var document = context.Document;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
66return cancellationToken => FixAllAsync(context.Document, diagnostics, cancellationToken);
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
42cancellationToken => AddPartNotDiscoverableAttributeAsync(context.Document, diagnostic.Location.SourceSpan, cancellationToken),
Roslyn.Diagnostics.CSharp.Analyzers (6)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (3)
37var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 44var semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false); 59cancellationToken => RemoveOptSuffixOnVariableAsync(context.Document, variableSymbol, newName, cancellationToken),
CSharpDoNotUseDebugAssertForInterpolatedStringsFixer.cs (2)
31var compilation = await context.Document.Project.GetCompilationAsync(context.CancellationToken).ConfigureAwait(false); 50ct => ReplaceWithDebugAssertAsync(context.Document, diagnostic.Location, roslynDebugSymbol, ct),
PreferNullLiteralCodeFixProvider.cs (1)
40cancellationToken => ReplaceWithNullLiteralAsync(context.Document, diagnostic.Location, cancellationToken),
System.Text.RegularExpressions.Generator (4)
UpgradeToGeneratedRegexCodeFixer.cs (4)
47if (await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false) is not SyntaxNode root || 67cancellationToken => ConvertFieldToGeneratedRegexProperty(context.Document, root, nodeToFix, fieldDeclaration, cancellationToken), 77cancellationToken => ConvertPropertyToGeneratedRegexProperty(context.Document, root, nodeToFix, propertyDeclaration, cancellationToken), 87cancellationToken => CreateGeneratedRegexProperty(context.Document, root, nodeToFix, cancellationToken),
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
34.Document 52createChangedDocument: c => AddDesignerSerializationAttribute(context.Document, propertyDeclaration, c),
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
40Document. 59document:=context.Document,