1 write to Span
Microsoft.CodeAnalysis.Workspaces (1)
CodeFixes\CodeFixContext.cs (1)
126Span = span;
78 references to Span
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
58var (invocationExpression, details) = await CheckIfCanFixAsync(context.Document, context.Span, context.CancellationToken).ConfigureAwait(false);
MakeExeTypesInternalFixer.cs (1)
29var node = root?.FindNode(context.Span);
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (1)
33context.RegisterCodeFix(new MyCodeAction(context.Document, context.Span), diagnostic);
Microsoft.CodeAnalysis.CodeStyle.Fixes (14)
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
38var diagnosticNode = root.FindNode(context.Span, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
76var position = context.Span.Start;
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
33if (!TryGetNode(root, context.Span, out var node))
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
33var parentMethod = root.FindNode(context.Span).FirstAncestorOrSelf<TMemberDeclarationSyntax>();
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
37var paramNode = GetParamNode(root, context.Span);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
44var names = GetTargetNodes(syntaxFacts, root, context.Span, diagnostic);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (2)
31var token = root.FindToken(context.Span.Start); 32if (!token.Span.IntersectsWith(context.Span))
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
33var span = context.Span;
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
29if (!TryGetNode(root, context.Span, out var node))
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
55var span = context.Span;
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
44var syntaxNode = Location.Create(syntaxTree, context.Span).FindNode(context.CancellationToken);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
165var node = root.FindNode(context.Span, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
37var node = syntaxRoot.FindNode(context.Span, getInnermostNodeForTie: true);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
35var (container, location) = GetContainer(root, context.Span);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
32var span = context.Span;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
52var span = context.Span;
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
35var span = context.Span;
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
39var span = context.Span;
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (3)
41var token = syntaxRoot.FindToken(context.Span.Start); 43if (token.Span == context.Span && 57c => ReplaceAsync(context.Document, context.Span, newExpression, c),
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (2)
41if (root.FindNode(context.Span) is VariableDeclarationSyntax variableDeclaration && 55c => FixAsync(document, context.Span, type, c),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
74if (root.FindNode(context.Span, getInnermostNodeForTie: true) is SimpleNameSyntax node)
Microsoft.CodeAnalysis.CSharp.Features (11)
Copilot\CSharpCopilotCodeFixProvider.cs (1)
82if (containingMethod?.Span.IntersectsWith(context.Span) is true)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
35var (container, location) = GetContainer(root, context.Span);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
32var span = context.Span;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
52var span = context.Span;
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
35var span = context.Span;
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
39var span = context.Span;
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (3)
41var token = syntaxRoot.FindToken(context.Span.Start); 43if (token.Span == context.Span && 57c => ReplaceAsync(context.Document, context.Span, newExpression, c),
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (2)
41if (root.FindNode(context.Span) is VariableDeclarationSyntax variableDeclaration && 55c => FixAsync(document, context.Span, type, c),
Microsoft.CodeAnalysis.Features (19)
AddImport\AbstractAddImportCodeFixProvider.cs (1)
54var span = context.Span;
CodeFixes\Suppression\WrapperCodeFixProvider.cs (1)
28var suppressionFixes = await SuppressionFixProvider.GetFixesAsync(context.Document, context.Span, documentDiagnostics, context.CancellationToken).ConfigureAwait(false);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
27var optFixData = await service.GetFixDataAsync(document, context.Span, cancellationToken).ConfigureAwait(false);
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (1)
78var span = context.Span;
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
43var span = context.Span;
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
38var diagnosticNode = root.FindNode(context.Span, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
76var position = context.Span.Start;
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
33if (!TryGetNode(root, context.Span, out var node))
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
33var parentMethod = root.FindNode(context.Span).FirstAncestorOrSelf<TMemberDeclarationSyntax>();
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
37var paramNode = GetParamNode(root, context.Span);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
44var names = GetTargetNodes(syntaxFacts, root, context.Span, diagnostic);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (2)
31var token = root.FindToken(context.Span.Start); 32if (!token.Span.IntersectsWith(context.Span))
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
33var span = context.Span;
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
29if (!TryGetNode(root, context.Span, out var node))
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
55var span = context.Span;
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
44var syntaxNode = Location.Create(syntaxTree, context.Span).FindNode(context.CancellationToken);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
165var node = root.FindNode(context.Span, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
37var node = syntaxRoot.FindNode(context.Span, getInnermostNodeForTie: true);
Microsoft.CodeAnalysis.VisualBasic.Features (11)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.vb (2)
39Dim node = root.FindNode(context.Span, getInnermostNodeForTie:=True) 51Dim indexOfControlVariable = nextStatement.ControlVariables.IndexOf(Function(n) n.Span.Contains(context.Span))
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (3)
67Dim token = root.FindToken(context.Span.Start) 68If Not token.Span.IntersectsWith(context.Span) Then 73.FirstOrDefault(Function(c) c.Span.IntersectsWith(context.Span) AndAlso IsCandidate(c))
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (3)
47Dim token = root.FindToken(context.Span.Start) 48If Not token.Span.IntersectsWith(context.Span) Then 53For Each node In token.GetAncestors(Of SyntaxNode).Where(Function(c) c.Span.IntersectsWith(context.Span) AndAlso IsCandidate(c))
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (1)
60Dim span = context.Span
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (1)
42Dim span = context.Span
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (1)
45Dim span = context.Span
Microsoft.CodeAnalysis.Workspaces (4)
CodeFixes\CodeFixContext.cs (4)
24/// Document corresponding to the <see cref="CodeFixContext.Span"/> to fix. 44/// TextDocument corresponding to the <see cref="Span"/> to fix. 58/// NOTE: All the diagnostics in this collection have the same <see cref="Span"/>. 228VerifyDiagnosticsArgument(diagnostics, Span);
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\AddMarshalAsToElementFixer.cs (1)
30SyntaxNode node = root.FindNode(context.Span);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
125SyntaxNode node = root.FindNode(context.Span);
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
116SyntaxNode node = root.FindNode(context.Span);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
125SyntaxNode node = root.FindNode(context.Span);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
51SyntaxNode nodeToFix = root.FindNode(context.Span, getInnermostNodeForTie: true);