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