1 write to Span
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
79Span = span;
81 references to Span
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
StringCopyPaste\StringCopyPasteData.cs (4)
100var firstOverlappingChar = virtualChars.FirstOrNull(vc => vc.Span.OverlapsWith(selectionSpan)); 101var lastOverlappingChar = virtualChars.LastOrNull(vc => vc.Span.OverlapsWith(selectionSpan)); 107if (selectionSpan.Start > firstOverlappingChar.Value.Span.Start) 110if (selectionSpan.End < lastOverlappingChar.Value.Span.End)
Microsoft.CodeAnalysis.CSharp.Features (10)
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
179if (ch.Span.Length == 2 && ch.Rune.Value != 0)
ConvertToRawString\ConvertToRawStringHelpers.cs (3)
54if (ch.Span.Length > 1) 97if (ch.Span.Length > 1 && SyntaxFacts.IsNewLine((char)ch.Value)) 116if (ch.Span.Length > 1)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (6)
28=> TextSpan.FromBounds(vc1.Span.Start, vc2.Span.End); 94virtualCharsWithoutMarkup.First().Span.Start, 95virtualCharsWithoutMarkup.Last().Span.End)); 254virtualChars[currentEndIndexExclusive - 1].Span.End == virtualChars[currentEndIndexExclusive].Span.Start)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (4)
58for (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"/> 34public TextSpan Span => VirtualChar.Span;
Microsoft.CodeAnalysis.Features (40)
EmbeddedLanguages\Classification\AbstractFallbackEmbeddedLanguageClassifier.cs (2)
50if (vc.Span.Length > vc.Rune.Utf16SequenceLength) 51context.AddClassification(ClassificationTypeNames.StringEscapeCharacter, vc.Span);
EmbeddedLanguages\DateAndTime\EmbeddedCompletionContext.cs (2)
64if (ch.Span.End <= startPosition) 66else 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)
497firstChar.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)
102return new EmbeddedDiagnostic(FeaturesResources.Illegal_whitespace_character, ch.Span); 158return new EmbeddedDiagnostic(FeaturesResources.Value_required, new TextSpan(node.ColonToken.VirtualChars[0].Span.End, 0)); 228return new EmbeddedDiagnostic(FeaturesResources.Strings_must_start_with_double_quote_not_single_quote, chars[0].Span); 233return new EmbeddedDiagnostic(FeaturesResources.Illegal_string_character, chars[i].Span); 242return new EmbeddedDiagnostic(FeaturesResources.Invalid_escape_sequence, TextSpan.FromBounds(chars[i].Span.Start, chars[i + 1].Span.End));
EmbeddedLanguages\Json\LanguageServices\JsonBraceMatcher.cs (1)
79if (!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)
161var spanStart = currentChar.Span.Start; 162var spanEnd = currentChar.Span.End; 172seenEscape = seenEscape || endChar.Span.Length > 1; 173spanEnd = endChar.Span.End; 176else if (endChar == ' ' && endChar.Span.Length == 1) 179spanEnd = 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)
118start = Math.Min(token.VirtualChars[0].Span.Start, start); 119end = Math.Max(token.VirtualChars.Last().Span.End, end);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (2)
86Math.Min(VirtualChars.Length == 0 ? int.MaxValue : VirtualChars[0].Span.Start, 91Math.Max(VirtualChars.Length == 0 ? int.MinValue : VirtualChars[^1].Span.End,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (10)
85Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 89Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 90currentVC.Span.Start == token.SpanStart + 2, "First span should start on the second or third char of the string."); 98Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 107Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 117Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 121Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 177index += 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)
48if (position < array[0].Span.Start || position >= array[^1].Span.End) 53if (position < ch.Span.Start) 56if (position >= ch.Span.End)