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