69 references to
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (4)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (2)
374Assert.Equal(allChars[position + i], virtualChars[i]);
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (2)
339Assert.Equal(allChars[position + i], virtualChars[i]);
Microsoft.CodeAnalysis.CSharp.Features (15)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (12)
176while (index < characters.Length && IsCSharpWhitespace(characters[index])) 179return index < characters.Length && IsCSharpNewLine(characters[index]); 185while (index >= 0 && IsCSharpWhitespace(characters[index])) 188return index >= 0 && IsCSharpNewLine(characters[index]); 348var ch = characters[i]; 457while (current < length && IsCSharpWhitespace(leadingWhitespace1[current]) && leadingWhitespace1[current].Rune == leadingWhitespace2[current].Rune) 466while (current < line.Length && IsCSharpWhitespace(line[current])) 485while (end < characters.Length && !IsCSharpNewLine(characters[end])) 499while (index < line.Length && IsCSharpWhitespace(line[index])) 502return index == line.Length || IsCSharpNewLine(line[index]);
ConvertToRawString\ConvertToRawStringHelpers.cs (3)
43characters[index].Rune is { Utf16SequenceLength: 1, Value: '\r' } && 44characters[index + 1].Rune is { Utf16SequenceLength: 1, Value: '\n' }; 114while (j < n && characters[j] == '"')
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EmbeddedLanguages\StackFrame\StackFrameParserTests.Utilities.cs (1)
105if (textSeq[index++] != ch)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (2)
EmbeddedLanguages\AspNetCoreVirtualCharSequence.cs (2)
33/// <inheritdoc cref="VirtualCharSequence.this"/> 34public AspNetCoreVirtualChar this[int index] => new(_virtualCharSequence[index]);
Microsoft.CodeAnalysis.Features (43)
EmbeddedLanguages\Json\JsonLexer.cs (4)
32public readonly VirtualChar CurrentChar => Text[Position]; 318=> TextSpan.FromBounds(Text[startInclusive].Span.Start, Text[endExclusive - 1].Span.End); 327if (position + i >= Text.Length || Text[position + i] != val[i])
EmbeddedLanguages\Json\JsonParser.cs (1)
537if (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\RegexBraceMatcher.cs (1)
83var lastChar = trivia.Value.VirtualChars[trivia.Value.VirtualChars.Length - 1];
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (2)
256if (index >= 2 && tree.Text[index - 2] == '\\') 258var escapeChar = tree.Text[index - 1];
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (12)
49public readonly VirtualChar CurrentChar => Position < Text.Length ? Text[Position] : default; 139if (Text[Position] == '#') 145Text[Position] != '\n') 158Text[Position] != ')') 179=> TextSpan.FromBounds(Text[startInclusive].Span.Start, Text[endExclusive - 1].Span.End); 189Text[position + i] != val[i]) 203while (Position < Text.Length && IsBlank(Text[Position])) 380Debug.Assert(Text[beforeSlash] == '\\'); 381Debug.Assert(Text[beforeSlash + 1].Value is 'x' or 'u'); 423Debug.Assert(Text[beforeSlash] == '\\'); 424Debug.Assert(IsOctalDigit(Text[start]));
EmbeddedLanguages\RegularExpressions\RegexParser.cs (10)
1599Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1645Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1683Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1698Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1704_lexer.Text[_lexer.Position] is var ch && 1737Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1759Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1760Debug.Assert(_lexer.Text[_lexer.Position].Value is '<' or '\''); 1842Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1966Debug.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; 124var ch = Text[Position]; 440Text[position + i] != val[i])
StackTraceExplorer\StackTraceAnalyzer.cs (3)
83if (callstack[i].Value == '\n') 108while (virtualChars[start].IsWhiteSpace && start < end) 113while (virtualChars[end].IsWhiteSpace && end > start)
StackTraceExplorer\VSDebugCallstackParser.cs (1)
27if (line[i].Value == '!')
Microsoft.CodeAnalysis.Workspaces (4)
AbstractVirtualCharService.cs (2)
98var nextVC = result[i]; 107var nextVC = result[i];
VirtualCharSequence.cs (1)
134var ch = this[i];
VirtualCharSequence.Enumerator.cs (1)
25public readonly VirtualChar Current => _virtualCharSequence[_position];