112 references to Length
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (8)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (4)
312
if (token.VirtualChars.
Length
> 0)
331
Assert.Equal(allChars.
Length
, position);
381
for (var i = 0; i < virtualChars.
Length
; i++)
384
position += virtualChars.
Length
;
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (4)
248
if (token.VirtualChars.
Length
> 0)
266
Assert.Equal(allChars.
Length
, position);
315
for (var i = 0; i < virtualChars.
Length
; i++)
320
position += virtualChars.
Length
;
Microsoft.CodeAnalysis.CSharp.Features (17)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (12)
108
while (index < characters.
Length
&& IsCSharpWhitespace(characters[index]))
111
return index < characters.
Length
&& IsCSharpNewLine(characters[index]);
116
var index = characters.
Length
- 1;
325
return commonLeadingWhitespace.
Length
;
331
var length = Math.Min(leadingWhitespace1.
Length
, leadingWhitespace2.
Length
);
343
while (current < line.
Length
&& IsCSharpWhitespace(line[current]))
353
while (index < characters.
Length
)
362
while (end < characters.
Length
&& !IsCSharpNewLine(characters[end]))
365
if (end != characters.
Length
)
376
while (index < line.
Length
&& IsCSharpWhitespace(line[index]))
379
return index == line.
Length
|| IsCSharpNewLine(line[index]);
ConvertToRawString\ConvertToRawStringHelpers.cs (4)
38
return index + 1 < characters.
Length
&&
87
for (var i = 0; i < characters.
Length
; i++)
116
if (i + 1 < characters.
Length
&&
146
for (int i = 0, n = characters.
Length
; i < n;)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (1)
139
for (int i = 0, n = virtualChars.
Length
; i < n;)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EmbeddedLanguages\StackFrame\StackFrameParserTests.Utilities.cs (1)
113
Assert.Equal(textSeq.
Length
, index);
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (2)
EmbeddedLanguages\AspNetCoreVirtualCharSequence.cs (2)
29
/// <inheritdoc cref="VirtualCharSequence.
Length
"/>
30
public int Length => _virtualCharSequence.
Length
;
Microsoft.CodeAnalysis.Features (74)
EmbeddedLanguages\Classification\AbstractFallbackEmbeddedLanguageClassifier.cs (1)
44
if (virtualChars.
Length
== token.Text.Length)
EmbeddedLanguages\Json\JsonLexer.cs (13)
42
if (Position == Text.
Length
)
50
Debug.Assert(chars.
Length
> 0);
62
Debug.Assert(Position < Text.
Length
);
91
while (Position < Text.
Length
)
124
if (this.Position == Text.
Length
)
144
for (var i = 0; this.Position < Text.
Length
&& i < 4; i++)
170
while (Position < Text.
Length
&& !IsNotPartOfText(this.CurrentChar))
198
while (Position < Text.
Length
)
281
while (Position < Text.
Length
&& this.CurrentChar.Value is not '\r' and not '\n')
302
while (Position < Text.
Length
&& !IsAt("*/"))
311
Debug.Assert(Position == Text.
Length
);
326
if (position + i >= Text.
Length
|| Text[position + i] != val[i])
336
while (Position < Text.
Length
&& char.IsWhiteSpace(this.CurrentChar))
EmbeddedLanguages\Json\JsonParser.cs (4)
123
Debug.Assert(_lexer.Position == _lexer.Text.
Length
);
170
if (text.
Length
> 0 &&
471
Debug.Assert(token.VirtualChars.
Length
> 0);
531
if (chars.
Length
!= val.Length)
EmbeddedLanguages\Json\JsonParser.JsonNetSyntaxChecks.cs (4)
70
var singleDigit = char.IsDigit(firstChar) && chars.
Length
== 1;
75
firstChar == '0' && chars.
Length
> 1 &&
80
Debug.Assert(chars.
Length
> 1);
111
Debug.Assert(chars.
Length
> 1 && chars[0] == '0');
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (2)
231
for (int i = 1, n = chars.
Length
- 1; i < n; i++)
238
for (int i = 1, n = chars.
Length
- 1; i < n;)
EmbeddedLanguages\Json\LanguageServices\JsonClassifier.cs (1)
110
trivia.VirtualChars.
Length
> 0)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexClassifier.cs (1)
98
trivia.VirtualChars.
Length
> 0)
EmbeddedLanguages\RegularExpressions\RegexHelpers.cs (1)
56
if (node.TypeToken.VirtualChars.
Length
> 0)
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (17)
47
public readonly VirtualChar CurrentChar => Position < Text.
Length
? Text[Position] : default;
58
if (Position == Text.
Length
)
106
while (Position < Text.
Length
)
130
if (Position >= Text.
Length
)
142
while (Position < Text.
Length
&&
155
while (Position < Text.
Length
&&
161
if (Position == Text.
Length
)
186
if (position + i >= Text.
Length
||
201
while (Position < Text.
Length
&& IsBlank(Text[Position]))
234
while (Position < Text.
Length
&& IsEscapeCategoryChar(this.CurrentChar))
261
if (Position == Text.
Length
)
272
while (Position < Text.
Length
&& this.CurrentChar is var ch && IsDecimalDigit(ch))
309
if (Position == Text.
Length
)
315
while (Position < Text.
Length
&& RegexCharClass.IsBoundaryWordChar(this.CurrentChar))
336
while (Position < Text.
Length
&& IsOptionChar(this.CurrentChar))
379
if (Position < Text.
Length
&& IsHexChar(this.CurrentChar))
425
if (Position < Text.
Length
&& IsOctalDigit(this.CurrentChar))
EmbeddedLanguages\RegularExpressions\RegexParser.cs (14)
168
Debug.Assert(_lexer.Position == _lexer.Text.
Length
);
992
if (_lexer.Position == _lexer.Text.
Length
)
1197
=> currentToken.Kind == RegexKind.TextToken && currentToken.VirtualChars.
Length
== 1 && currentToken.VirtualChars[0].Value == ch;
1265
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1491
if (_currentToken.Kind == RegexKind.BackslashToken && _lexer.Position < _lexer.Text.
Length
)
1498
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1597
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1643
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1688
while (_lexer.Position < _lexer.Text.
Length
&&
1797
if (_lexer.Position < _lexer.Text.
Length
&&
1831
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1838
Debug.Assert(octalDigits.VirtualChars.
Length
> 0);
1905
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1984
if (_lexer.Text.
Length
- _lexer.Position < "{x}".Length)
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (7)
58
public readonly VirtualChar CurrentChar => Position < Text.
Length
? Text[Position] : default;
68
if (Position == Text.
Length
)
74
Position = Text.
Length
;
123
if (Position == Text.
Length
)
244
while (Position < Text.
Length
)
417
Debug.Assert(virtualChars.
Length
> 0);
442
if (position + i >= Text.
Length
||
EmbeddedLanguages\StackFrame\StackFrameParser.cs (1)
89
Contract.ThrowIfFalse(_lexer.Position == _lexer.Text.
Length
);
SpellCheck\AbstractSpellCheckSpanService.cs (2)
152
while (currentCharIndex < virtualChars.
Length
)
165
while (currentCharIndex < virtualChars.
Length
)
StackTraceExplorer\StackTraceAnalyzer.cs (4)
75
for (var i = 0; i < callstack.
Length
; i++)
86
if (position < callstack.
Length
)
94
if (virtualChars.
Length
== 0)
100
var end = virtualChars.
Length
- 1;
StackTraceExplorer\VSDebugCallstackParser.cs (2)
23
for (var i = 0; i < line.
Length
; i++)
33
if (startPoint <= 0 || startPoint == line.
Length
)
Microsoft.CodeAnalysis.Workspaces (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (3)
81
if (LeadingTrivia.Length == 0 && VirtualChars.
Length
== 0 && TrailingTrivia.Length == 0)
86
Math.Min(VirtualChars.
Length
== 0 ? int.MaxValue : VirtualChars[0].Span.Start,
91
Math.Max(VirtualChars.
Length
== 0 ? int.MinValue : VirtualChars[^1].Span.End,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28
Debug.Assert(virtualChars.
Length
> 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (3)
83
if (result.
Length
> 0)
96
for (var i = 1; i < result.
Length
; i++)
105
for (var i = 1; i < result.
Length
; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
185
public bool MoveNext() => ++_position < virtualCharSequence.
Length
;
204
public static bool IsEmpty(this VirtualCharSequence sequence) => sequence.
Length
== 0;
259
for (var i = sequence.
Length
- 1; i >= 0; i--)