128 references to Span
Microsoft.CodeAnalysis (3)
Diagnostic\SourceLocation.cs (1)
43: this(trivia.SyntaxTree!, trivia.Span)
Syntax\SyntaxTrivia.cs (2)
101/// Same as accessing <see cref="TextSpan.Start"/> on <see cref="Span"/>. 412return this.SyntaxTree!.GetLocation(this.Span);
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
185end = trivia.Span.End;
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
283hasPragmaInAnalysisSpan = hasPragmaInAnalysisSpan || !span.HasValue || span.Value.OverlapsWith(trivia.Span); 565if (pragma.Span.End <= diagnostic.Location.SourceSpan.Start)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (1)
10=> trivia.Span.Length;
Microsoft.CodeAnalysis.CSharp (1)
Syntax\SyntaxReplacer.cs (1)
499: base(originalTrivia.Span, editKind, true, originalTrivia.IsPartOfStructuredTrivia())
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
534if (textSpan.Contains(trivia.Span))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (2)
75if (trivia.Span.End == currentParent.SpanStart || 76trivia.Span.End == currentParent.Span.End)
Microsoft.CodeAnalysis.CSharp.Features (7)
BraceMatching\BlockCommentBraceMatcher.cs (2)
50return new BraceMatchingResult(new TextSpan(trivia.SpanStart, "/*".Length), TextSpan.FromBounds(trivia.Span.End - "*/".Length, trivia.Span.End));
ExtractMethod\Extensions.cs (1)
174if (!textSpan.Contains(trivia.Span))
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
113spanEnd = nearbyComment.Span.End;
Structure\CSharpStructureHelpers.cs (1)
153var span = TextSpan.FromBounds(startComment.SpanStart, endComment.Span.End);
Structure\Providers\MultilineCommentBlockStructureProvider.cs (2)
21textSpan: trivia.Span, 22hintSpan: trivia.Span,
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (46)
LexicalAndXml\LexicalTests.cs (38)
3879Assert.True(trivia.Span.Length == 8); 3958Assert.Equal(22, trivia.Span.Length); 3971Assert.Equal(16, trivia.Span.Length); 3980Assert.Equal(16, trivia.Span.Start); 3981Assert.Equal(2, trivia.Span.Length); 3985Assert.Equal(18, trivia.Span.Start); 3986Assert.Equal(13, trivia.Span.Length); 3995Assert.Equal(16, trivia.Span.Length); 4004Assert.Equal(2, trivia.Span.Length); 4008Assert.Equal(34, trivia.Span.Length); 4016Assert.Equal(16, trivia1.Span.Length); 4025Assert.Equal(16, trivia2.Span.Start); 4026Assert.Equal(2, trivia2.Span.Length); 4030Assert.Equal(18, trivia3.Span.Start); 4031Assert.Equal(15, trivia3.Span.Length); 4035Assert.Equal(33, trivia4.Span.Start); 4036Assert.Equal(24, trivia4.Span.Length); 4049Assert.Equal(16, trivia1.Span.Length); 4058Assert.Equal(16, trivia2.Span.Start); 4059Assert.Equal(2, trivia2.Span.Length); 4063Assert.Equal(18, trivia3.Span.Start); 4064Assert.Equal(24, trivia3.Span.Length); 4097Assert.Equal(22, trivia.Span.Length); 4105Assert.Equal(16, trivia.Span.Length); 4109Assert.Equal(19, trivia.Span.Start); 4110Assert.Equal(2, trivia.Span.Length); 4114Assert.Equal(21, trivia.Span.Start); 4115Assert.Equal(13, trivia.Span.Length); 4124Assert.Equal(16, trivia.Span.Length); 4128Assert.Equal(2, trivia.Span.Length); 4132Assert.Equal(34, trivia.Span.Length); 4140Assert.Equal(16, trivia1.Span.Length); 4144Assert.Equal(19, trivia2.Span.Start); 4145Assert.Equal(2, trivia2.Span.Length); 4149Assert.Equal(21, trivia3.Span.Start); 4150Assert.Equal(15, trivia3.Span.Length); 4154Assert.Equal(36, trivia4.Span.Start); 4155Assert.Equal(24, trivia4.Span.Length);
ParentChecker.cs (2)
27var tspan = trivia.Span; 40var tspan = trivia.Span;
Syntax\SyntaxAnnotationTests.cs (4)
376Assert.Equal(oldTrivia.Span, newTrivia.Span); 652Assert.Equal(oldTrivia.Span, annotatedTrivia.Span);
Syntax\SyntaxNodeTests.cs (2)
793Assert.Equal(0, trivia.Span.End); 2090Assert.Equal(method.ReturnType.GetLastToken().TrailingTrivia[0].Span, triviaLocation.SourceSpan);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Classification\Worker.cs (1)
64=> AddClassification(trivia.Span, type);
Classification\Worker_DocumentationComments.cs (2)
116spanStart = trivia.Span.Start + index; 123var span = TextSpan.FromBounds(spanStart.Value, trivia.Span.End);
Rename\CSharpRenameRewriterLanguageService.cs (2)
674var oldSpan = trivia.Span; 676AddModifiedSpan(oldSpan, newTrivia.Span);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
534if (textSpan.Contains(trivia.Span))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (2)
75if (trivia.Span.End == currentParent.SpanStart || 76trivia.Span.End == currentParent.Span.End)
Microsoft.CodeAnalysis.EditorFeatures (2)
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (2)
94if (trivia.Span.Start == position && _provider.ShouldSelectEntireTriviaFromStart(trivia)) 97return new TextExtent(trivia.Span.ToSnapshotSpan(position.Snapshot), isSignificant: true);
Microsoft.CodeAnalysis.Features (4)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
209start: Math.Max(0, trivia.Span.Start - 1),
SpellCheck\AbstractSpellCheckSpanService.cs (1)
251AddSpan(new SpellCheckSpan(trivia.Span, SpellCheckKind.Comment));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
185end = trivia.Span.End;
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
283hasPragmaInAnalysisSpan = hasPragmaInAnalysisSpan || !span.HasValue || span.Value.OverlapsWith(trivia.Span);
Microsoft.CodeAnalysis.UnitTests (12)
CommonSyntaxTests.cs (12)
119var correctSpan = csharpTrivia.Span; 124Assert.Equal(correctSpan, commonTrivia.Span); 129Assert.Equal(correctSpan, commonTrivia2.Span); 135Assert.Equal(correctSpan, commonTrivia3.Span); 138Assert.Equal(correctSpan, csharpTrivia2.Span); 143Assert.Equal(correctSpan, csharpTrivia3.Span); 156var correctSpan = vbTrivia.Span; 161Assert.Equal(correctSpan, commonTrivia.Span); 166Assert.Equal(correctSpan, commonTrivia2.Span); 172Assert.Equal(correctSpan, commonTrivia3.Span); 175Assert.Equal(correctSpan, vbTrivia2.Span); 180Assert.Equal(correctSpan, vbTrivia3.Span);
Microsoft.CodeAnalysis.VisualBasic (2)
Syntax\VisualBasicSyntaxNode.vb (2)
282Return New VBDiagnostic(errorInfo, If(tree Is Nothing, New SourceLocation(tree, nodeOrToken.Span), tree.GetLocation(nodeOrToken.Span)))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
393If textSpan.Contains(trivia.Span) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
283If trivia.Span.Start > position Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (2)
26If trivia.IsKind(SyntaxKind.LineContinuationTrivia) AndAlso trivia.Span.End <= position Then 29ElseIf trivia.IsKind(SyntaxKind.EndOfLineTrivia) AndAlso trivia.Span.End <= position Then
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
LineCommit\ContainingStatementInfo.vb (1)
33TextSpan = trivia.Span
Microsoft.CodeAnalysis.VisualBasic.Features (3)
BraceCompletion\BracketBraceCompletionService.vb (1)
55Dim span = trivia.Span
Structure\Providers\DisabledTextTriviaStructureProvider.vb (1)
21Dim nodeSpan = trivia.Span
Structure\VisualBasicStructureHelpers.vb (1)
29Dim span = TextSpan.FromBounds(startComment.SpanStart, endComment.Span.End)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (11)
Syntax\SyntaxAnnotationTests.vb (4)
349Assert.Equal(oldTrivia.Span, newTrivia.Span) 592Assert.Equal(oldTrivia.Span, annotatedTrivia.Span)
TestSyntaxNodes.vb (7)
710Assert.Equal(4, follTrivia(0).Span.End) 716Assert.Equal(5, follTrivia(1).Span.End) 741Assert.Equal(4, precTrivia(0).Span.End) 747Assert.Equal(6, precTrivia(1).Span.End) 753Assert.Equal(9, precTrivia(2).Span.End) 762Assert.Equal(11, follTrivia(0).Span.End) 2355Assert.Equal(24, trivia.Span.End)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (4)
ParserTestUtilities.vb (4)
143span = trivia.Span 159span = trivia.Span 807Assert.True(0 <> tr.Span.Length, "Unexpected 0 width trivia: " & node.Kind().ToString & node.Span.ToString) 813Assert.True(0 <> tr.Span.Length, "Unexpected 0 width trivia: " & node.Kind().ToString & node.Span.ToString)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (10)
Classification\Worker.DocumentationCommentClassifier.vb (2)
92spanStart = trivia.Span.Start + index 98Dim span = TextSpan.FromBounds(spanStart.Value, trivia.Span.End)
Classification\Worker.vb (2)
54If trivia.Width() > 0 AndAlso _textSpan.OverlapsWith(trivia.Span) Then 55AddClassification(trivia.Span, classificationType)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
607Dim oldSpan = trivia.Span 609AddModifiedSpan(oldSpan, newTrivia.Span)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (1)
393If textSpan.Contains(trivia.Span) Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
283If trivia.Span.Start > position Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (2)
26If trivia.IsKind(SyntaxKind.LineContinuationTrivia) AndAlso trivia.Span.End <= position Then 29ElseIf trivia.IsKind(SyntaxKind.EndOfLineTrivia) AndAlso trivia.Span.End <= position Then
Microsoft.CodeAnalysis.Workspaces (3)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
389.Where(t => t.Span.Length >= renameTextLength) 390.Select(t => Tuple.Create(t.ToString(), t.Span.Start, t.Token.Span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (1)
10=> trivia.Span.Length;