114 references to Length
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (8)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (4)
304
if (token.VirtualChars.
Length
> 0)
323
Assert.Equal(allChars.
Length
, position);
373
for (var i = 0; i < virtualChars.
Length
; i++)
376
position += virtualChars.
Length
;
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (4)
270
if (token.VirtualChars.
Length
> 0)
288
Assert.Equal(allChars.
Length
, position);
337
for (var i = 0; i < virtualChars.
Length
; i++)
342
position += virtualChars.
Length
;
Microsoft.CodeAnalysis.CSharp.Features (16)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (14)
167
CleanupWhitespace(characters).
Length
> 0;
176
while (index < characters.
Length
&& IsCSharpWhitespace(characters[index]))
179
return index < characters.
Length
&& IsCSharpNewLine(characters[index]);
184
var index = characters.
Length
- 1;
346
for (int i = 0, n = characters.
Length
; i < n; i++)
448
return commonLeadingWhitespace.
Length
;
454
var length = Math.Min(leadingWhitespace1.
Length
, leadingWhitespace2.
Length
);
466
while (current < line.
Length
&& IsCSharpWhitespace(line[current]))
476
while (index < characters.
Length
)
485
while (end < characters.
Length
&& !IsCSharpNewLine(characters[end]))
488
if (end != characters.
Length
)
499
while (index < line.
Length
&& IsCSharpWhitespace(line[index]))
502
return index == line.
Length
|| IsCSharpNewLine(line[index]);
ConvertToRawString\ConvertToRawStringHelpers.cs (2)
42
return index + 1 < characters.
Length
&&
111
for (int i = 0, n = characters.
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)
30
/// <inheritdoc cref="VirtualCharSequence.
Length
"/>
31
public int Length => _virtualCharSequence.
Length
;
Microsoft.CodeAnalysis.Features (75)
EmbeddedLanguages\Classification\AbstractFallbackEmbeddedLanguageClassifier.cs (1)
43
if (virtualChars.
Length
== token.Text.Length)
EmbeddedLanguages\Json\JsonLexer.cs (13)
43
if (Position == Text.
Length
)
51
Debug.Assert(chars.
Length
> 0);
63
Debug.Assert(Position < Text.
Length
);
92
while (Position < Text.
Length
)
125
if (this.Position == Text.
Length
)
145
for (var i = 0; this.Position < Text.
Length
&& i < 4; i++)
171
while (Position < Text.
Length
&& !IsNotPartOfText(this.CurrentChar))
199
while (Position < Text.
Length
)
282
while (Position < Text.
Length
&& this.CurrentChar.Value is not '\r' and not '\n')
303
while (Position < Text.
Length
&& !IsAt("*/"))
312
Debug.Assert(Position == Text.
Length
);
327
if (position + i >= Text.
Length
|| Text[position + i] != val[i])
337
while (Position < Text.
Length
&& this.CurrentChar.IsWhiteSpace)
EmbeddedLanguages\Json\JsonParser.cs (5)
124
Debug.Assert(_lexer.Position == _lexer.Text.
Length
);
171
if (text.
Length
> 0 &&
403
literalToken.VirtualChars.GetSubSequence(TextSpan.FromBounds(1, literalToken.VirtualChars.
Length
)),
472
Debug.Assert(token.VirtualChars.
Length
> 0);
532
if (chars.
Length
!= val.Length)
EmbeddedLanguages\Json\JsonParser.JsonNetSyntaxChecks.cs (3)
71
var singleDigit = firstChar.IsDigit && chars.
Length
== 1;
76
firstChar == '0' && chars.
Length
> 1 &&
82
Debug.Assert(chars.
Length
> 1);
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (2)
230
for (int i = 1, n = chars.
Length
- 1; i < n; i++)
237
for (int i = 1, n = chars.
Length
- 1; i < n;)
EmbeddedLanguages\Json\LanguageServices\JsonClassifier.cs (1)
100
trivia.VirtualChars.
Length
> 0)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexBraceMatcher.cs (1)
83
var lastChar = trivia.Value.VirtualChars[trivia.Value.VirtualChars.
Length
- 1];
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)
49
public readonly VirtualChar CurrentChar => Position < Text.
Length
? Text[Position] : default;
60
if (Position == Text.
Length
)
108
while (Position < Text.
Length
)
132
if (Position >= Text.
Length
)
144
while (Position < Text.
Length
&&
157
while (Position < Text.
Length
&&
163
if (Position == Text.
Length
)
188
if (position + i >= Text.
Length
||
203
while (Position < Text.
Length
&& IsBlank(Text[Position]))
236
while (Position < Text.
Length
&&
267
if (Position == Text.
Length
)
278
while (Position < Text.
Length
&& this.CurrentChar is var ch && IsDecimalDigit(ch))
315
if (Position == Text.
Length
)
321
while (Position < Text.
Length
&& RegexCharClass.IsBoundaryWordChar(this.CurrentChar))
342
while (Position < Text.
Length
&& IsOptionChar(this.CurrentChar))
385
if (Position < Text.
Length
&& IsHexChar(this.CurrentChar))
431
if (Position < Text.
Length
&& IsOctalDigit(this.CurrentChar))
EmbeddedLanguages\RegularExpressions\RegexParser.cs (14)
170
Debug.Assert(_lexer.Position == _lexer.Text.
Length
);
970
if (_lexer.Position == _lexer.Text.
Length
)
1175
=> currentToken.Kind == RegexKind.TextToken && currentToken.VirtualChars.
Length
== 1 && currentToken.VirtualChars[0].Value == ch;
1243
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1476
if (_currentToken.Kind == RegexKind.BackslashToken && _lexer.Position < _lexer.Text.
Length
)
1483
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1612
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1658
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1703
while (_lexer.Position < _lexer.Text.
Length
&&
1812
if (_lexer.Position < _lexer.Text.
Length
&&
1846
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1853
Debug.Assert(octalDigits.VirtualChars.
Length
> 0);
1920
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1999
if (_lexer.Text.
Length
- _lexer.Position < "{x}".Length)
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (7)
60
public readonly VirtualChar CurrentChar => Position < Text.
Length
? Text[Position] : default;
70
if (Position == Text.
Length
)
76
Position = Text.
Length
;
119
if (Position == Text.
Length
)
240
while (Position < Text.
Length
)
414
Debug.Assert(virtualChars.
Length
> 0);
439
if (position + i >= Text.
Length
||
EmbeddedLanguages\StackFrame\StackFrameParser.cs (1)
90
Contract.ThrowIfFalse(_lexer.Position == _lexer.Text.
Length
);
StackTraceExplorer\StackTraceAnalyzer.cs (5)
81
for (var i = 0; i < callstack.
Length
; i++)
92
if (position < callstack.
Length
)
94
yield return callstack.GetSubSequence(TextSpan.FromBounds(position, callstack.
Length
));
100
if (virtualChars.
Length
== 0)
106
var end = virtualChars.
Length
- 1;
StackTraceExplorer\VSDebugCallstackParser.cs (3)
25
for (var i = 0; i < line.
Length
; i++)
35
if (startPoint <= 0 || startPoint == line.
Length
)
40
var textToParse = line.GetSubSequence(TextSpan.FromBounds(startPoint, line.
Length
));
Microsoft.CodeAnalysis.Workspaces (12)
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++)
EmbeddedSyntaxToken.cs (3)
78
if (LeadingTrivia.Length == 0 && VirtualChars.
Length
== 0 && TrailingTrivia.Length == 0)
83
Math.Min(VirtualChars.
Length
== 0 ? int.MaxValue : VirtualChars[0].Span.Start,
88
Math.Max(VirtualChars.
Length
== 0 ? int.MinValue : VirtualChars[^1].Span.End,
EmbeddedSyntaxTrivia.cs (1)
28
Debug.Assert(virtualChars.
Length
> 0);
VirtualCharSequence.cs (4)
80
public bool IsEmpty =>
Length
== 0;
132
for (var i = this.
Length
- 1; i >= 0; i--)
165
=> this.GetSubSequence(TextSpan.FromBounds(count, this.
Length
));
178
return this.GetSubSequence(TextSpan.FromBounds(start, this.
Length
));
VirtualCharSequence.Enumerator.cs (1)
24
public bool MoveNext() => ++_position < _virtualCharSequence.
Length
;