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