80 references to
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (4)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (2)
382Assert.Equal(allChars[position + i], virtualChars[i]);
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (2)
317Assert.Equal(allChars[position + i], virtualChars[i]);
Microsoft.CodeAnalysis.CSharp.Features (25)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (12)
109while (index < characters.Length && IsCSharpWhitespace(characters[index])) 112return index < characters.Length && IsCSharpNewLine(characters[index]); 118while (index >= 0 && IsCSharpWhitespace(characters[index])) 121return index >= 0 && IsCSharpNewLine(characters[index]); 220var ch = characters[i]; 325while (current < length && IsCSharpWhitespace(leadingWhitespace1[current]) && leadingWhitespace1[current].Rune == leadingWhitespace2[current].Rune) 334while (current < line.Length && IsCSharpWhitespace(line[current])) 353while (end < characters.Length && !IsCSharpNewLine(characters[end])) 367while (index < line.Length && IsCSharpWhitespace(line[index])) 370return index == line.Length || IsCSharpNewLine(line[index]);
ConvertToRawString\ConvertToRawStringHelpers.cs (3)
41characters[index].Rune is { Utf16SequenceLength: 1, Value: '\r' } && 42characters[index + 1].Rune is { Utf16SequenceLength: 1, Value: '\n' }; 144while (j < n && characters[j] == c)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (10)
146var vc1 = virtualChars[i]; 147var vc2 = i + 1 < n ? virtualChars[i + 1] : default; 180var vc3 = i + 2 < n ? virtualChars[i + 2] : default; 215var colonChar = virtualChars[seekPoint]; 218markdownSpans.Add(FromBounds(virtualChars[start], colonChar)); 254virtualChars[currentEndIndexExclusive - 1].Span.End == virtualChars[currentEndIndexExclusive].Span.Start) 261FromBounds(virtualChars[currentStartIndexInclusive], virtualChars[currentEndIndexExclusive - 1])); 288get => (char)_virtualChars[position].Value;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EmbeddedLanguages\StackFrame\StackFrameParserTests.Utilities.cs (1)
105if (textSeq[index++] != ch)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (2)
EmbeddedLanguages\AspNetCoreVirtualCharSequence.cs (2)
31/// <inheritdoc cref="VirtualCharSequence.this"/> 32public AspNetCoreVirtualChar this[int index] => new(_virtualCharSequence[index]);
Microsoft.CodeAnalysis.Features (44)
EmbeddedLanguages\Json\JsonLexer.cs (4)
31public readonly VirtualChar CurrentChar => Text[Position]; 317=> TextSpan.FromBounds(Text[startInclusive].Span.Start, Text[endExclusive - 1].Span.End); 326if (position + i >= Text.Length || Text[position + i] != val[i])
EmbeddedLanguages\Json\JsonParser.cs (1)
536if (chars[i] != val[i])
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (6)
232if (chars[i] < ' ') 233return new EmbeddedDiagnostic(FeaturesResources.Illegal_string_character, chars[i].Span); 239if (chars[i] == '\\') 241if (chars[i + 1] == '\'') 242return new EmbeddedDiagnostic(FeaturesResources.Invalid_escape_sequence, TextSpan.FromBounds(chars[i].Span.Start, chars[i + 1].Span.End));
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (2)
253if (index >= 2 && tree.Text[index - 2] == '\\') 255var escapeChar = tree.Text[index - 1];
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (12)
47public readonly VirtualChar CurrentChar => Position < Text.Length ? Text[Position] : default; 137if (Text[Position] == '#') 143Text[Position] != '\n') 156Text[Position] != ')') 177=> TextSpan.FromBounds(Text[startInclusive].Span.Start, Text[endExclusive - 1].Span.End); 187Text[position + i] != val[i]) 201while (Position < Text.Length && IsBlank(Text[Position])) 374Debug.Assert(Text[beforeSlash] == '\\'); 375Debug.Assert(Text[beforeSlash + 1].Value is 'x' or 'u'); 417Debug.Assert(Text[beforeSlash] == '\\'); 418Debug.Assert(IsOctalDigit(Text[start]));
EmbeddedLanguages\RegularExpressions\RegexParser.cs (10)
1563Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1609Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1647Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1662Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1668_lexer.Text[_lexer.Position] is var ch && 1701Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1723Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1724Debug.Assert(_lexer.Text[_lexer.Position].Value is '<' or '\''); 1806Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1930Debug.Assert(_lexer.Text[_lexer.Position - 1] is var ch && (ch == 'P' || ch == 'p'));
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (3)
60public readonly VirtualChar CurrentChar => Position < Text.Length ? Text[Position] : default; 130var ch = Text[Position]; 445Text[position + i] != val[i])
SpellCheck\AbstractSpellCheckSpanService.cs (2)
154var currentChar = virtualChars[currentCharIndex]; 167var endChar = virtualChars[currentCharIndex];
StackTraceExplorer\StackTraceAnalyzer.cs (3)
77if (callstack[i].Value == '\n') 102while (virtualChars[start].IsWhiteSpace && start < end) 107while (virtualChars[end].IsWhiteSpace && end > start)
StackTraceExplorer\VSDebugCallstackParser.cs (1)
25if (line[i].Value == '!')
Microsoft.CodeAnalysis.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (2)
97var nextVC = result[i]; 106var nextVC = result[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
134var ch = this[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Enumerator.cs (1)
17public readonly VirtualChar Current => virtualCharSequence[_position];