1 write to Span
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
79
Span
= span;
81 references to Span
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
StringCopyPaste\StringCopyPasteData.cs (4)
100
var firstOverlappingChar = virtualChars.FirstOrNull(vc => vc.
Span
.OverlapsWith(selectionSpan));
101
var lastOverlappingChar = virtualChars.LastOrNull(vc => vc.
Span
.OverlapsWith(selectionSpan));
107
if (selectionSpan.Start > firstOverlappingChar.Value.
Span
.Start)
110
if (selectionSpan.End < lastOverlappingChar.Value.
Span
.End)
Microsoft.CodeAnalysis.CSharp.Features (10)
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
179
if (ch.
Span
.Length == 2 && ch.Rune.Value != 0)
ConvertToRawString\ConvertToRawStringHelpers.cs (3)
54
if (ch.
Span
.Length > 1)
97
if (ch.
Span
.Length > 1 && SyntaxFacts.IsNewLine((char)ch.Value))
116
if (ch.
Span
.Length > 1)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (6)
28
=> TextSpan.FromBounds(vc1.
Span
.Start, vc2.
Span
.End);
94
virtualCharsWithoutMarkup.First().
Span
.Start,
95
virtualCharsWithoutMarkup.Last().
Span
.End));
254
virtualChars[currentEndIndexExclusive - 1].
Span
.End == virtualChars[currentEndIndexExclusive].
Span
.Start)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (4)
58
for (var i = ch.
Span
.Start; i < ch.
Span
.End; i++)
90
=> $"[{ConvertRuneToString(vc)},[{vc.
Span
.Start - _statementPrefix.Length},{vc.
Span
.End - _statementPrefix.Length}]]";
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (2)
EmbeddedLanguages\AspNetCoreVirtualChar.cs (2)
33
/// <inheritdoc cref="VirtualChar.
Span
"/>
34
public TextSpan Span => VirtualChar.
Span
;
Microsoft.CodeAnalysis.Features (40)
EmbeddedLanguages\Classification\AbstractFallbackEmbeddedLanguageClassifier.cs (2)
50
if (vc.
Span
.Length > vc.Rune.Utf16SequenceLength)
51
context.AddClassification(ClassificationTypeNames.StringEscapeCharacter, vc.
Span
);
EmbeddedLanguages\DateAndTime\EmbeddedCompletionContext.cs (2)
64
if (ch.
Span
.End <= startPosition)
66
else if (ch.
Span
.Start >= endPosition)
EmbeddedLanguages\Json\JsonLexer.cs (2)
317
=> TextSpan.FromBounds(Text[startInclusive].
Span
.Start, Text[endExclusive - 1].
Span
.End);
EmbeddedLanguages\Json\JsonParser.cs (3)
497
firstChar.
Span
)));
591
? new TextSpan(_lexer.Text.Last().
Span
.End, 0)
592
: new TextSpan(token.VirtualChars[0].
Span
.Start, 0);
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (6)
102
return new EmbeddedDiagnostic(FeaturesResources.Illegal_whitespace_character, ch.
Span
);
158
return new EmbeddedDiagnostic(FeaturesResources.Value_required, new TextSpan(node.ColonToken.VirtualChars[0].
Span
.End, 0));
228
return new EmbeddedDiagnostic(FeaturesResources.Strings_must_start_with_double_quote_not_single_quote, chars[0].
Span
);
233
return new EmbeddedDiagnostic(FeaturesResources.Illegal_string_character, chars[i].
Span
);
242
return new EmbeddedDiagnostic(FeaturesResources.Invalid_escape_sequence, TextSpan.FromBounds(chars[i].
Span
.Start, chars[i + 1].
Span
.End));
EmbeddedLanguages\Json\LanguageServices\JsonBraceMatcher.cs (1)
79
if (!fullSpan.Value.Contains(ch.
Span
.Start))
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexBraceMatcher.cs (4)
74
: new BraceMatchingResult(open.VirtualChars[0].
Span
, close.VirtualChars[0].
Span
);
86
: new BraceMatchingResult(firstChar.
Span
, lastChar.
Span
);
EmbeddedLanguages\RegularExpressions\RegexHelpers.cs (8)
43
'a' => VirtualChar.Create(new Rune('\u0007'), ch.
Span
), // bell
44
'b' => VirtualChar.Create(new Rune('\b'), ch.
Span
), // backspace
45
'e' => VirtualChar.Create(new Rune('\u001B'), ch.
Span
), // escape
46
'f' => VirtualChar.Create(new Rune('\f'), ch.
Span
), // form feed
47
'n' => VirtualChar.Create(new Rune('\n'), ch.
Span
), // new line
48
'r' => VirtualChar.Create(new Rune('\r'), ch.
Span
), // carriage return
49
't' => VirtualChar.Create(new Rune('\t'), ch.
Span
), // tab
50
'v' => VirtualChar.Create(new Rune('\u000B'), ch.
Span
), // vertical tab
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (2)
177
=> TextSpan.FromBounds(Text[startInclusive].
Span
.Start, Text[endExclusive - 1].
Span
.End);
EmbeddedLanguages\RegularExpressions\RegexParser.cs (2)
711
? new TextSpan(_lexer.Text.Last().
Span
.End, 0)
712
: new TextSpan(token.VirtualChars[0].
Span
.Start, 0);
SpellCheck\AbstractSpellCheckSpanService.cs (6)
161
var spanStart = currentChar.
Span
.Start;
162
var spanEnd = currentChar.
Span
.End;
172
seenEscape = seenEscape || endChar.
Span
.Length > 1;
173
spanEnd = endChar.
Span
.End;
176
else if (endChar == ' ' && endChar.
Span
.Length == 1)
179
spanEnd = endChar.
Span
.End;
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (2)
248
: TextSpan.FromBounds(sequence.First().
Span
.Start, sequence.Last().
Span
.End);
Microsoft.CodeAnalysis.Workspaces (21)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxHelpers.cs (2)
19
=> TextSpan.FromBounds(firstChar.
Span
.Start, lastChar.
Span
.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (2)
118
start = Math.Min(token.VirtualChars[0].
Span
.Start, start);
119
end = Math.Max(token.VirtualChars.Last().
Span
.End, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (2)
86
Math.Min(VirtualChars.Length == 0 ? int.MaxValue : VirtualChars[0].
Span
.Start,
91
Math.Max(VirtualChars.Length == 0 ? int.MinValue : VirtualChars[^1].
Span
.End,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (10)
85
Debug.Assert(currentVC.
Span
.Start >= token.SpanStart, "First span has to start after the start of the string token");
89
Debug.Assert(currentVC.
Span
.Start == token.SpanStart + 1 ||
90
currentVC.
Span
.Start == token.SpanStart + 2, "First span should start on the second or third char of the string.");
98
Debug.Assert(currentVC.
Span
.End <= nextVC.
Span
.Start, "Virtual character spans have to be ordered.");
107
Debug.Assert(currentVC.
Span
.End == nextVC.
Span
.Start, "Virtual character spans have to be touching.");
117
Debug.Assert(lastVC.
Span
.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token.");
121
Debug.Assert(lastVC.
Span
.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token.");
177
index += result[^1].
Span
.Length;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\IVirtualCharService.cs (1)
51
/// Similarly, each VirtualChar's <see cref="VirtualChar.
Span
"/> will abut each other, and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (4)
48
if (position < array[0].
Span
.Start || position >= array[^1].
Span
.End)
53
if (position < ch.
Span
.Start)
56
if (position >= ch.
Span
.End)