1056 references to Span
ConfigurationSchemaGenerator (1)
Microsoft.Analyzers.Extra (1)
Microsoft.AspNetCore.App.Analyzers (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
Microsoft.CodeAnalysis (13)
Microsoft.CodeAnalysis.CodeStyle (39)
Microsoft.CodeAnalysis.CodeStyle.Fixes (22)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
59if (node?.Span != span)
Microsoft.CodeAnalysis.CSharp (51)
Microsoft.CodeAnalysis.CSharp.CodeStyle (56)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (7)
133Location.Create(tree, ifStatement.Span),
134Location.Create(tree, expressionStatement.Span));
201if (nextToken.Span.Start < ifStatement.Span.End)
203fadeLocation = Location.Create(tree, TextSpan.FromBounds(nextToken.Span.Start, ifStatement.Span.End));
321Location.Create(tree, localDeclarationStatement.Span),
322Location.Create(tree, ifStatement.Span),
323Location.Create(tree, expressionStatement.Span));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (46)
StringCopyPaste\StringInfo.cs (8)
91var end = SkipU8Suffix(text, literal.Span.End);
105endDelimiterSpan: TextSpan.FromBounds(end, literal.Span.End),
146TextSpan.FromBounds(rawEnd, literal.Span.End),
167var end = SkipU8Suffix(text, literal.Span.End);
176endDelimiterSpan: TextSpan.FromBounds(end, literal.Span.End),
197var end = SkipU8Suffix(text, interpolatedString.Span.End);
210currentPosition = content.Span.End;
220endDelimiterSpan: TextSpan.FromBounds(interpolatedString.StringEndToken.SpanStart, interpolatedString.Span.End),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (21)
Microsoft.CodeAnalysis.CSharp.Features (197)
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
68declaredType.Span);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (39)
101declarations = (recordDeclaration.ParameterList != null && activeSpan.OverlapsWith(recordDeclaration.ParameterList.Span))
297Debug.Assert(position == switchExpression.Span.Start);
353ForEachPart.Expression => node.Expression.Span,
361ForEachPart.VariableDeclaration => TextSpan.FromBounds(node.Variable.SpanStart, node.Variable.Span.End),
363ForEachPart.Expression => node.Expression.Span,
370SwitchExpressionPart.WholeExpression => node.Span,
610span = ((ArrowExpressionClauseSyntax)node).Expression.Span;
663span = ((SwitchExpressionArmSyntax)node).Expression.Span;
1283oldTypeDeclaration.TypeParameterList?.Span != newTypeDeclaration.TypeParameterList?.Span;
1287oldTypeDeclaration.ParameterList?.Span != newTypeDeclaration.ParameterList?.Span)
1608=> TryGetDiagnosticSpanImpl(node, editKind) ?? node.Span;
1635return node.Span;
1639return node.Span;
1644return TextSpan.FromBounds(ns.NamespaceKeyword.SpanStart, ns.Name.Span.End);
1679return node.Span;
1714return node.Span;
1727return TextSpan.FromBounds(constraint.WhereKeyword.SpanStart, constraint.Constraints.Last().Span.End);
1743return node.Span;
1755return node.Span;
1792return node.Span;
1807(switchStatement.CloseParenToken != default) ? switchStatement.CloseParenToken.Span.End : switchStatement.Expression.Span.End);
1810return ((SwitchSectionSyntax)node).Labels.Last().Span;
1855return node.Span;
1859return CombineSpans(localDeclarationStatement.AwaitKeyword.Span, localDeclarationStatement.UsingKeyword.Span, node.Span);
1869return CombineSpans(parenthesizedLambda.ReturnType?.Span ?? default, parenthesizedLambda.ParameterList.Span, defaultSpan: default);
1872return ((SimpleLambdaExpressionSyntax)node).Parameter.Span;
1907return node.Span;
1926return node.Span;
1963return lambda.Span;
2692return tryStatement.Finally.Span;
2698? tryStatement.Finally.Span.End
2699: tryStatement.Catches.Last().Span.End);
2703return node.Span;
2708return tryStatement.Span;
2733diagnosticContext.Report(RudeEditKind.AwaitStatementUpdate, newContainingStatementPart.Span);
2954AddAroundActiveStatementRudeDiagnostic(diagnostics, oldCheckedStatement, newCheckedStatement, newActiveStatement.Span);
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (7)
133Location.Create(tree, ifStatement.Span),
134Location.Create(tree, expressionStatement.Span));
201if (nextToken.Span.Start < ifStatement.Span.End)
203fadeLocation = Location.Create(tree, TextSpan.FromBounds(nextToken.Span.Start, ifStatement.Span.End));
321Location.Create(tree, localDeclarationStatement.Span),
322Location.Create(tree, ifStatement.Span),
323Location.Create(tree, expressionStatement.Span));
Structure\Providers\ArgumentListStructureProvider.cs (1)
24node.Span));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\GlobalUsingDirectiveTests.cs (4)
4979Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString());
4980Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString());
4984Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsExpression).ToTestDisplayString());
4985Assert.Equal("alias1=C1", model.GetSpeculativeAliasInfo(tree.GetRoot().Span.End, alias1, SpeculativeBindingOption.BindAsTypeOrNamespace).ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (16)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
Syntax\SyntaxNodeTests.cs (9)
729Assert.Equal(root, root.FindNode(root.Span, findInsideTrivia: false));
730Assert.Equal(root, root.FindNode(root.Span, findInsideTrivia: true));
736var position = identifier.Span.Start + 1;
738Assert.Equal(classDecl, root.FindNode(identifier.Span, findInsideTrivia: false));
739Assert.Equal(identifier, root.FindNode(identifier.Span, findInsideTrivia: true));
1781Assert.Equal(rootNode.Span.Length, rootNode.ToString().Length);
1799Assert.Equal(rootNode.Span.Length, rootNode.ToString().Length);
1814Assert.Equal(namespaceNode.Span, nodeOrToken.Span);
2080Assert.Equal(method.Span, nodeLocation.SourceSpan);
Microsoft.CodeAnalysis.CSharp.Workspaces (64)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.NodeSyntaxReference.cs (1)
25=> _node.Span;
Microsoft.CodeAnalysis.EditorFeatures (2)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Microsoft.CodeAnalysis.Features (77)
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
54property.Span);
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
64from.Span);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
106top.Span);
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
111invocation.Span);
MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs (1)
50declaration.Span);
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
59if (node?.Span != span)
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.VisualBasic (41)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (12)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (10)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (8)
Microsoft.CodeAnalysis.VisualBasic.Features (99)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (27)
157While node.Span.Length < span.Length AndAlso node.Parent.SpanStart = position
1004Return DirectCast(model.GetEnclosingSymbol(lambdaExpressionSyntax.SubOrFunctionHeader.Span.End, cancellationToken), IMethodSymbol)
1074Return If(TryGetDiagnosticSpanImpl(node, editKind), node.Span)
1100Return node.Span
1176Return node.Span
1188Return node.Span
1193Return node.Span
1230Return DirectCast(node, SyncLockBlockSyntax).SyncLockStatement.Span
1233Return DirectCast(node, WithBlockSyntax).WithStatement.Span
1236Return DirectCast(node, UsingBlockSyntax).UsingStatement.Span
1243Return DirectCast(node, DoLoopBlockSyntax).DoStatement.Span
1246Return DirectCast(node, WhileBlockSyntax).WhileStatement.Span
1250Return DirectCast(node, ForOrForEachBlockSyntax).ForOrForEachStatement.Span
1264Return DirectCast(node, LambdaExpressionSyntax).SubOrFunctionHeader.Span
1295Return node.Span
1308Return node.Span
1314Return node.Span
1320If(thenKeywordOpt.RawKind <> 0, thenKeywordOpt.Span.End, condition.Span.End))
1324Return TextSpan.FromBounds(node.NamespaceKeyword.SpanStart, node.Name.Span.End)
1421Return DirectCast(lambda, LambdaExpressionSyntax).SubOrFunctionHeader.ParameterList.Parameters(ordinal).Identifier.Span
1424Return lambda.Span
2135Return TextSpan.FromBounds(tryBlock.FinallyBlock.SpanStart, tryBlock.EndTryStatement.Span.End)
2138Return TextSpan.FromBounds(tryBlock.CatchBlocks.First().SpanStart, tryBlock.EndTryStatement.Span.End)
2142Return node.Span
2146Return DirectCast(node.Parent, TryBlockSyntax).Span
2183diagnosticContext.Report(RudeEditKind.AwaitStatementUpdate, newContainingStatementPart.Span)
2297AddAroundActiveStatementRudeDiagnostic(diagnostics, oldActiveStatement, onErrorOrResumeStatement, newActiveStatement.Span)
Structure\Providers\CollectionInitializerStructureProvider.vb (1)
40node.Span.End)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (14)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (20)
TestSyntaxNodes.vb (18)
324Assert.True(tree.FullSpan.Contains(tree.Span))
328Assert.Equal(tree.Span, tree.FullSpan)
340Assert.Equal(tree.Span.End, tree.FullSpan.End)
342VerifyListSpans(followingTrivia, New TextSpan(tree.Span.End, (tree.FullSpan.End - tree.Span.End)))
375Assert.Equal(New TextSpan(0, 1), dig1.Span)
381Assert.Equal(New TextSpan(0, 4), binop.Span)
384Assert.Equal(New TextSpan(3, 1), binop.Right.Span)
388Assert.Equal(New TextSpan(0, 17), simpleTree.Span)
390Assert.Equal(New TextSpan(3, 14), DirectCast(simpleTree, BinaryExpressionSyntax).Right.Span)
393Assert.Equal(New TextSpan(6, 1), argList.Arguments(0).Span)
395Assert.Equal(New TextSpan(9, 4), argList.Arguments(1).Span)
397Assert.Equal(New TextSpan(15, 1), argList.Arguments(2).Span)
596Assert.Equal(start + 3, seplist(0).Span.End)
816Assert.Equal(7, endTry.Span.Length)
927Assert.Equal(0, endIfStmt.Span.Length)
2256Assert.Equal(root, root.FindNode(root.Span, findInsideTrivia:=False))
2257Assert.Equal(root, root.FindNode(root.Span, findInsideTrivia:=True))
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (9)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (56)
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.NodeSyntaxReference.vb (1)
26Return _node.Span
Microsoft.CodeAnalysis.Workspaces (53)
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (1)
316nameSyntax.Span,
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.VisualStudio.LanguageServices (6)
CodeLens\RemoteCodeLensReferencesService.cs (4)
57(service, solutionInfo, cancellationToken) => service.GetReferenceCountAsync(solutionInfo, documentId, syntaxNode.Span, maxSearchResults, cancellationToken),
103(service, solutionInfo, cancellationToken) => service.FindReferenceMethodsAsync(solutionInfo, documentId, syntaxNode.Span, cancellationToken),
128(service, solutionInfo, cancellationToken) => service.GetFullyQualifiedNameAsync(solutionInfo, documentId, syntaxNode.Span, cancellationToken),
266(service, solutionInfo, cancellationToken) => service.FindReferenceLocationsAsync(solutionInfo, documentId, syntaxNode.Span, cancellationToken),
Microsoft.VisualStudio.LanguageServices.CSharp (19)
Microsoft.VisualStudio.LanguageServices.VisualBasic (38)
System.Text.RegularExpressions.Generator (2)