145 references to Span
Microsoft.CodeAnalysis.Razor.Compiler (20)
Language\Syntax\ChildSyntaxList.cs (1)
215Debug.Assert(node.Span.Contains(targetPosition));
Language\Syntax\SyntaxList`1.cs (2)
112? TextSpan.FromBounds(this[0].Span.Start, this[Count - 1].Span.End)
Language\Syntax\SyntaxNode.cs (8)
185if (!Span.Contains(position)) 289return DescendantNodesImpl(Span, descendIntoChildren, includeSelf: false); 308return DescendantNodesImpl(Span, descendIntoChildren, includeSelf: true); 327return DescendantNodesAndTokensImpl(Span, descendIntoChildren, includeSelf: false); 346return DescendantNodesAndTokensImpl(Span, descendIntoChildren, includeSelf: true); 363return DescendantNodesAndTokens(Span, descendIntoChildren) 439if (!Span.Contains(position)) 518if (currentToken.Kind == SyntaxKind.None || currentToken.Span.End > this.Span.End)
Language\Syntax\SyntaxNode.Iterators.cs (3)
17if (includeSelf && IsInSpan(in span, Span)) 41if (includeSelf && IsInSpan(in span, Span)) 142if (IsInSpan(in span, nodeValue.Span))
Language\Syntax\SyntaxNodeOrToken.cs (1)
176return _nodeOrParent.Span;
Language\Syntax\SyntaxReplacer.cs (4)
90_spanSet.Add(node.Span); 162if (ShouldVisit(node.Span)) 258if (ShouldVisit(node.Span)) 277: base(originalNode.Span, editKind)
Language\Syntax\SyntaxSerializer.cs (1)
49WriteSpan(node.Span);
Microsoft.CodeAnalysis.Razor.Workspaces (119)
CodeActions\Razor\ComponentAccessibilityCodeActionProvider.cs (2)
321if (!(diagnostic.Span.AbsoluteIndex > startTag.Span.End 322|| startTag.Span.Start > diagnostic.Span.AbsoluteIndex + diagnostic.Span.Length))
CodeActions\Razor\ExtractToCodeBehindCodeActionProvider.cs (4)
106ExtractStart = csharpCodeBlockNode.Span.Start, 107ExtractEnd = csharpCodeBlockNode.Span.End, 108RemoveStart = directiveNode.Span.Start, 109RemoveEnd = directiveNode.Span.End,
CodeActions\Razor\ExtractToComponentCodeActionProvider.cs (13)
155? TextSpan.FromBounds(startNode.Span.Start, endNode.Span.End) 168if (startNode is MarkupTextLiteralSyntax && startNode.Span.IntersectsWith(selectionSpan.Start)) 173if (endNode is MarkupTextLiteralSyntax && endNode.Span.IntersectsWith(selectionSpan.End)) 185var commonAncestor = endNode.Span.Contains(startNode.Span) 194if (commonAncestor.Span.Contains(startNode.Span) && 195commonAncestor.Span.Contains(endNode.Span)) 227if (child.Span.Contains(startNode.Span)) 234if (child.Span.Contains(endNode.Span)) 251return commonAncestor.Span;
CodeActions\Razor\ExtractToCssCodeActionProvider.cs (4)
82ExtractStart = textLiteral.Span.Start, 83ExtractEnd = textLiteral.Span.End, 84RemoveStart = markupElement.Span.Start, 85RemoveEnd = markupElement.Span.End
CodeActions\Razor\PromoteUsingCodeActionProvider.cs (1)
51UsingEnd = directive.Span.End,
CodeActions\Razor\SimplifyFullyQualifiedComponentCodeActionProvider.cs (1)
103var startTagSpan = startTag.Span;
CodeActions\Razor\UnboundDirectiveAttributeAddUsingCodeActionProvider.cs (1)
55var nameSpan = attributeBlock.Name.Span;
CodeActions\Razor\WrapAttributesCodeActionProvider.cs (2)
52sourceText.TryGetFirstNonWhitespaceOffset(attribute.Span, out var indentSizeOffset); 63if (!sourceText.TryGetFirstNonWhitespaceOffset(attribute.Span, out var startOffset))
Completion\Delegation\DelegatedCompletionHelper.cs (2)
234if (startOrEndTag.Span.Start == absoluteIndex) 241return !startOrEndTag.Span.Contains(absoluteIndex);
Completion\Delegation\DesignTimeHelperResponseRewriter.cs (1)
87var span = owner.Span;
Completion\DirectiveAttributeCompletionItemProviderBase.cs (16)
35prefixLocation = minimizedMarkupAttribute.NamePrefix?.Span; 38minimizedMarkupAttribute.Name.Span, 46prefixLocation = markupAttribute.NamePrefix?.Span; 49markupAttribute.Name.Span, 57prefixLocation = minimizedTagHelperAttribute.NamePrefix?.Span; 60minimizedTagHelperAttribute.Name.Span, 68prefixLocation = tagHelperAttribute.NamePrefix?.Span; 71tagHelperAttribute.Name.Span, 83var nameEnd = attributeNameNode?.Span.End ?? directiveAttributeTransition.AssumeNotNull().Span.End; 84prefixLocation = directiveAttribute.NamePrefix?.Span; 88parameterLocation = directiveAttribute.ParameterName?.Span ?? default; 97var nameEnd = attributeNameNode?.Span.End ?? directiveAttributeTransition.AssumeNotNull().Span.End; 98prefixLocation = minimizedDirectiveAttribute.NamePrefix?.Span; 102parameterLocation = minimizedDirectiveAttribute.ParameterName?.Span ?? default;
Completion\DirectiveAttributeEventParameterCompletionItemProvider.cs (1)
44if (!valueSyntax.Span.Contains(context.AbsoluteIndex) && valueSyntax.EndPosition != context.AbsoluteIndex)
Completion\TagHelperCompletionProvider.cs (2)
161attributeSyntax.Span.Start < absoluteIndex && attributeSyntax.Span.End >= absoluteIndex;
Diagnostics\RazorTranslateDiagnosticsService.cs (2)
441if (!processedAttributes.TryGetValue(markupAttributeValue.Span, out var shouldFilterDiagnostic)) 450processedAttributes.Add(markupAttributeValue.Span, shouldFilterDiagnostic);
DocumentMapping\RazorEditService_UsingDirectives.cs (7)
111var start = nodeToInsertAfter.Span.End; 165var startPosition = existingUsings[0].Span.Start; 166var endPosition = existingUsings[^1].Span.End; 209var startPosition = firstBlockOfUsings[0].Span.Start; 210var endPosition = firstBlockOfUsings[^1].Span.End; 230var start = node.Span.Start; 231var end = AdjustPositionToEndOfLine(node.Span.End, text);
Extensions\RazorSyntaxNodeExtensions.cs (6)
172var index = firstNode.Span.End; 173var end = secondNode.Span.Start - 1; 239if (token.Kind == SyntaxKind.EndOfFile && node.Span.Contains(index - 1)) 267if (!@this.Span.Contains(span)) 274.FirstAncestorOrSelf<SyntaxNode>(a => a.Span.Contains(span)); 499var span = node.Span;
FoldingRanges\AbstractSyntaxNodeFoldingProvider.cs (1)
24var (start, end) = sourceText.GetLinePositionSpan(node.Span);
Formatting\FormattingVisitor.cs (1)
589AddSpan(node.Span, kind);
Formatting\Passes\CSharpFormattingPass.CSharpDocumentGenerator.cs (5)
314if (_sourceText.GetLinePositionSpan(node.Span).SpansMultipleLines()) 514_sourceText.GetLinePositionSpan(template.Span).SpansMultipleLines()) 810!_sourceText.GetLinePositionSpan(template.Span).SpansMultipleLines() || 898if (_sourceText.GetLinePositionSpan(node.Span).SpansMultipleLines()) 938_sourceText.GetLinePositionSpan(template.Span).SpansMultipleLines())
Formatting\Passes\CSharpOnTypeFormattingPass.cs (5)
346owner.SpanStart == template.Span.End && 500template.SpanStart == owner.Span.End && 547var linePositionSpan = text.GetLinePositionSpan(node.Span); 658var blockSpan = block.Span; 1093context.SourceText.GetRange(explicitExpression.Span) is { } exprRange &&
Formatting\Passes\HtmlFormattingPass.cs (1)
296commentBuilder.Add(comment.Span);
Formatting\Passes\RazorFormattingPass.cs (2)
362changes.Add(new TextChange(node.Span, newText)); 423closeBraceNode.Span.Length > 0 &&
Formatting\UsingDirectiveHelper.cs (8)
136var usingDirectiveLineIndex = codeDocument.Source.Text.GetLinePosition(usingDirective.Node.Span.Start).Line; 142var endIndex = existingUsingDirectives[^1].Node.Span.End; 164var lineIndex = GetLineIndexOrEnd(codeDocument, lastNamespaceOrPageDirective.Span.End - 1) + 1; 246var prevLine = sourceText.GetLinePosition(usingDirectives[i - 1].Span.End).Line; 247var currentLine = sourceText.GetLinePosition(usingDirectives[i].Span.Start).Line; 281builder.AppendLine(sourceText.ToString(directive.Span)); 291editBuilder.Add(GetRemoveDirectiveEdit(sourceText, directive.Span)); 295var firstDirectiveLine = sourceText.GetLinePosition(usingDirectives[0].Span.Start).Line;
GoToDefinition\RazorComponentDefinitionHelpers.cs (4)
88var selectedAttribute = startTag.Attributes.FirstOrDefault(absoluteIndex, static (a, absoluteIndex) => a.Span.Contains(absoluteIndex) || a.Span.End == absoluteIndex); 97nameSpan = attribute.Name.Span; 103nameSpan = minimizedAttribute.Name.Span;
Hover\HoverFactory.cs (1)
135var attribute = attributes.First(a => a.Span.IntersectsWith(absoluteIndex));
HtmlFacts.cs (14)
231prefixLocation = minimizedAttributeBlock.NamePrefix?.Span; 233selectedAttributeNameLocation = minimizedAttributeBlock.Name.Span; 236prefixLocation = attributeBlock.NamePrefix?.Span; 238selectedAttributeNameLocation = attributeBlock.Name.Span; 241prefixLocation = tagHelperAttribute.NamePrefix?.Span; 243selectedAttributeNameLocation = tagHelperAttribute.Name.Span; 246prefixLocation = minimizedAttribute.NamePrefix?.Span; 248selectedAttributeNameLocation = minimizedAttribute.Name.Span; 252prefixLocation = tagHelperDirectiveAttribute.NamePrefix?.Span; 254var fullNameSpan = TextSpan.FromBounds(tagHelperDirectiveAttribute.Transition.Span.Start, tagHelperDirectiveAttribute.Name.Span.End); 260prefixLocation = minimizedTagHelperDirectiveAttribute.NamePrefix?.Span; 262var fullNameSpan = TextSpan.FromBounds(minimizedTagHelperDirectiveAttribute.Transition.Span.Start, minimizedTagHelperDirectiveAttribute.Name.Span.End);
RazorSyntaxFacts.cs (6)
91MarkupAttributeBlockSyntax att => att.Name.Span, 92MarkupMinimizedAttributeBlockSyntax att => att.Name.Span, 93MarkupTagHelperAttributeSyntax att => att.Name.Span, 94MarkupMinimizedTagHelperAttributeSyntax att => att.Name.Span, 103var length = attributeName.Span.Length; 115length += 1 + parameterName.Span.Length;
SemanticTokens\SemanticTokensVisitor.cs (2)
55if (node != null && IsInRange(node.Span)) 552if (!IsInRange(node.Span))
SpellCheck\SpellCheckService.cs (2)
74if (textLiteralSyntax.Span.Length == 0) 79ranges.Add(new((int)VSInternalSpellCheckableRangeKind.String, textLiteralSyntax.SpanStart, textLiteralSyntax.Span.Length));
Utilities\WrapWithTagHelper.cs (2)
86(requestSpan == codeBlock.Span || requestSpan.Length == 0)) 89wrappingRange = sourceText.GetLinePositionSpan(codeBlock.Span);
Microsoft.CodeAnalysis.Razor.Workspaces.UnitTests (2)
FindNodeTests.cs (2)
259Assert.Equal(start, node.Span.Start); 260Assert.Equal(end, node.Span.End);
Microsoft.CodeAnalysis.Remote.Razor (4)
Debugging\RemoteDebugInfoService.cs (1)
142hostDocumentIndex = node.Span.End + 1;
DevTools\RemoteDevToolsService.cs (1)
196SpanEnd = node.Span.End,
Diagnostics\RemoteDiagnosticsService.cs (1)
87unusedDirectiveSpans.Add(directive.Span);
RemoveAndSortUsings\RemoteRemoveAndSortUsingsService.cs (1)
63if (!unusedDirectiveSpans.Contains(directive.Span))