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