119 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 (19)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (14)
94
CleanupWhitespace(characters).
Length
> 0;
109
while (index < characters.
Length
&& IsCSharpWhitespace(characters[index]))
112
return index < characters.
Length
&& IsCSharpNewLine(characters[index]);
117
var index = characters.
Length
- 1;
218
for (int i = 0, n = characters.
Length
; i < n; i++)
316
return commonLeadingWhitespace.
Length
;
322
var length = Math.Min(leadingWhitespace1.
Length
, leadingWhitespace2.
Length
);
334
while (current < line.
Length
&& IsCSharpWhitespace(line[current]))
344
while (index < characters.
Length
)
353
while (end < characters.
Length
&& !IsCSharpNewLine(characters[end]))
356
if (end != characters.
Length
)
367
while (index < line.
Length
&& IsCSharpWhitespace(line[index]))
370
return index == line.
Length
|| IsCSharpNewLine(line[index]);
ConvertToRawString\ConvertToRawStringHelpers.cs (2)
40
return index + 1 < characters.
Length
&&
141
for (int i = 0, n = characters.
Length
; i < n;)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (3)
122
new TextSpan(0, virtualCharsWithoutMarkup.
Length
),
144
for (int i = 0, n = virtualChars.
Length
; i < n;)
282
public override int Length => _virtualChars.
Length
;
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)
28
/// <inheritdoc cref="VirtualCharSequence.
Length
"/>
29
public int Length => _virtualCharSequence.
Length
;
Microsoft.CodeAnalysis.Features (77)
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
&& this.CurrentChar.IsWhiteSpace)
EmbeddedLanguages\Json\JsonParser.cs (5)
123
Debug.Assert(_lexer.Position == _lexer.Text.
Length
);
170
if (text.
Length
> 0 &&
402
literalToken.VirtualChars.GetSubSequence(TextSpan.FromBounds(1, literalToken.VirtualChars.
Length
)),
471
Debug.Assert(token.VirtualChars.
Length
> 0);
531
if (chars.
Length
!= val.Length)
EmbeddedLanguages\Json\JsonParser.JsonNetSyntaxChecks.cs (4)
70
var singleDigit = firstChar.IsDigit && 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)
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)
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
);
971
if (_lexer.Position == _lexer.Text.
Length
)
1176
=> currentToken.Kind == RegexKind.TextToken && currentToken.VirtualChars.
Length
== 1 && currentToken.VirtualChars[0].Value == ch;
1244
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1470
if (_currentToken.Kind == RegexKind.BackslashToken && _lexer.Position < _lexer.Text.
Length
)
1477
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1576
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1622
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1667
while (_lexer.Position < _lexer.Text.
Length
&&
1776
if (_lexer.Position < _lexer.Text.
Length
&&
1810
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1817
Debug.Assert(octalDigits.VirtualChars.
Length
> 0);
1884
Debug.Assert(_currentToken.VirtualChars.
Length
== 1);
1963
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
;
125
if (Position == Text.
Length
)
246
while (Position < Text.
Length
)
419
Debug.Assert(virtualChars.
Length
> 0);
444
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 (5)
75
for (var i = 0; i < callstack.
Length
; i++)
86
if (position < callstack.
Length
)
88
yield return callstack.GetSubSequence(TextSpan.FromBounds(position, callstack.
Length
));
94
if (virtualChars.
Length
== 0)
100
var end = virtualChars.
Length
- 1;
StackTraceExplorer\VSDebugCallstackParser.cs (3)
23
for (var i = 0; i < line.
Length
; i++)
33
if (startPoint <= 0 || startPoint == line.
Length
)
38
var textToParse = line.GetSubSequence(TextSpan.FromBounds(startPoint, line.
Length
));
Microsoft.CodeAnalysis.Workspaces (12)
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)
82
if (result.
Length
> 0)
95
for (var i = 1; i < result.
Length
; i++)
104
for (var i = 1; i < result.
Length
; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\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
));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Enumerator.cs (1)
16
public bool MoveNext() => ++_position < virtualCharSequence.
Length
;