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