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