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 (22)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (11)
108while (index < characters.Length && IsCSharpWhitespace(characters[index])) 111return index < characters.Length && IsCSharpNewLine(characters[index]); 117while (index >= 0 && IsCSharpWhitespace(characters[index])) 120return index >= 0 && IsCSharpNewLine(characters[index]); 334while (current < length && IsCSharpWhitespace(leadingWhitespace1[current]) && leadingWhitespace1[current].Value == leadingWhitespace2[current].Value) 343while (current < line.Length && IsCSharpWhitespace(line[current])) 362while (end < characters.Length && !IsCSharpNewLine(characters[end])) 376while (index < line.Length && IsCSharpWhitespace(line[index])) 379return index == line.Length || IsCSharpNewLine(line[index]);
ConvertToRawString\ConvertToRawStringHelpers.cs (6)
39characters[index] == '\r' && 40characters[index + 1] == '\n'; 89var ch = characters[i]; 118char.IsLowSurrogate(characters[i + 1]) && 119!IsFormatOrControl(Rune.GetUnicodeCategory(new Rune(ch, characters[i + 1])))) 149while (j < n && characters[j] == c)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (5)
141var vc1 = virtualChars[i]; 142var vc2 = i + 1 < n ? virtualChars[i + 1] : default; 175var vc3 = i + 2 < n ? virtualChars[i + 2] : default; 210var colonChar = virtualChars[seekPoint]; 213markdownSpans.Add(FromBounds(virtualChars[start], colonChar));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EmbeddedLanguages\StackFrame\StackFrameParserTests.Utilities.cs (1)
105if (textSeq[index++] != ch)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (2)
EmbeddedLanguages\AspNetCoreVirtualCharSequence.cs (2)
32/// <inheritdoc cref="VirtualCharSequence.this"/> 33public AspNetCoreVirtualChar this[int index] => new(_virtualCharSequence[index]);
Microsoft.CodeAnalysis.Features (46)
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)
233if (chars[i] < ' ') 234return new EmbeddedDiagnostic(FeaturesResources.Illegal_string_character, chars[i].Span); 240if (chars[i] == '\\') 242if (chars[i + 1] == '\'') 243return 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 (12)
377Contract.ThrowIfTrue(startCharacter != text[firstCharIndex.Value]); 378Contract.ThrowIfTrue(lastCharacter != text[lastCharIndex.Value]); 1584Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1630Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1668Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1683Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1689_lexer.Text[_lexer.Position] is var ch && 1722Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1744Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1745Debug.Assert(_lexer.Text[_lexer.Position].Value is '<' or '\''); 1827Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1951Debug.Assert(_lexer.Text[_lexer.Position - 1] is var ch && (ch == 'P' || ch == 'p'));
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (3)
58public readonly VirtualChar CurrentChar => Position < Text.Length ? Text[Position] : default; 128var ch = Text[Position]; 443Text[position + i] != val[i])
SpellCheck\AbstractSpellCheckSpanService.cs (2)
154var currentChar = virtualChars[currentCharIndex]; 167var endChar = virtualChars[currentCharIndex];
StackTraceExplorer\StackTraceAnalyzer.cs (3)
77if (callstack[i] == '\n') 102while (char.IsWhiteSpace(virtualChars[start]) && start < end) 107while (char.IsWhiteSpace(virtualChars[end]) && end > start)
StackTraceExplorer\VSDebugCallstackParser.cs (1)
25if (line[i] == '!')
Microsoft.CodeAnalysis.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (2)
98var nextVC = result[i]; 107var nextVC = result[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
186public readonly VirtualChar Current => virtualCharSequence[_position]; 201return index is null ? null : sequence[index.Value]; 261var ch = sequence[i];