Implemented interface member:
4 overrides of Count
Microsoft.CodeAnalysis (3)
Text\CompositeText.cs (1)
466public override int Count => _lineCount;
Text\SourceText.cs (1)
974public override int Count => _lineStarts.Count;
Text\SubText.cs (1)
198public override int Count => _lineCount;
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
147public override int Count
91 references to Count
Microsoft.AspNetCore.App.Analyzers (2)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (2)
212var lastLineExclusive = tokenIncludeDelimiters ? tokenSourceText.Lines.Count - 1 : tokenSourceText.Lines.Count;
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
384if (expectedLines.Length != sourceText.Lines.Count) 386message = $"Line numbers do not match. Expected: {expectedLines.Length} lines, but generated {sourceText.Lines.Count}";
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
384if (expectedLines.Length != sourceText.Lines.Count) 386message = $"Line numbers do not match. Expected: {expectedLines.Length} lines, but generated {sourceText.Lines.Count}";
Microsoft.CodeAnalysis (8)
Text\CompositeText.cs (4)
450accumulatedLineCount += (segment.Lines.Count - 1); 514Debug.Assert((nextSegment.Lines.Count == 1) || 515(nextSegment.Lines.Count == 2 && nextSegment.Lines[1].SpanIncludingLineBreak.IsEmpty)); 525Debug.Assert(lastSegment.Lines.Count >= 1);
Text\TextLineCollection.cs (4)
65if (position.Line >= this.Count) 67throw new ArgumentOutOfRangeException(nameof(position.Line), string.Format(CodeAnalysisResources.LineCannotBeGreaterThanEnd, position.Line, this.Count)); 113if (ndx >= 0 && ndx < _lines.Count) 126if (_index < _lines.Count - 1)
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
174if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
211for (var i = startLine.LineNumber + 1; i < lines.Count; i++)
Microsoft.CodeAnalysis.CSharp (2)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1078var referencedLineCount = referencedLines.Count; 1274var referencedLineCount = referencedLines.Count;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
201var lastLineExclusive = tokenIncludeDelimiters ? tokenSourceText.Lines.Count - 1 : tokenSourceText.Lines.Count;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (6)
InlineRename\CSharpEditorInlineRenameService.cs (3)
124var fallbackEndLine = Math.Min(documentText.Lines.Count - 1, documentText.Lines.GetLineFromPosition(fallbackSpan.End).LineNumber + NumberOfContextLines); 130endLine = Math.Min(documentText.Lines.Count - 1, fallbackEndLine + excessAtStart); 152endLine = Math.Min(documentText.Lines.Count - 1, documentText.Lines.GetLineFromPosition(fallbackSpan.End).LineNumber + NumberOfContextLines);
StringCopyPaste\KnownSourcePasteProcessor.cs (1)
292for (var i = 0; i < sourceText.Lines.Count; i++)
StringCopyPaste\UnknownSourcePasteProcessor.cs (2)
182for (var i = 0; i < textOfCurrentChange.Lines.Count; i++) 248for (int lineIndex = 0, lastLineIndex = textOfCurrentChange.Lines.Count; lineIndex < lastLineIndex; lineIndex++)
Microsoft.CodeAnalysis.CSharp.Features (4)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
296for (int i = 1, n = text.Lines.Count; i < n; i++)
LineSeparators\CSharpLineSeparatorService.cs (1)
333if (line == syntaxTree.GetText(cancellationToken).Lines.Count - 1)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
122for (var line = semicolonLine + 1; line < text.Lines.Count; line++)
Structure\Providers\IfDirectiveTriviaStructureProvider.cs (1)
47if (startLineNumber >= text.Lines.Count || endLineNumber < 0)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Diagnostics\LineSpanDirectiveTests.cs (2)
498if (position.Line < lines.Count) 503return (lines.Count == 0) ? 0 : lines[^1].End;
Parsing\ParserRegressionTests.cs (1)
163var lines1 = tree.GetText().Lines.Count; // 3
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
201var lastLineExclusive = tokenIncludeDelimiters ? tokenSourceText.Lines.Count - 1 : tokenSourceText.Lines.Count;
Microsoft.CodeAnalysis.EditorFeatures (2)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (2)
323var lastLine = lines.Count > 0 ? lines[^1] : default; 331if (lines.Count > 1 && lastLine.ToString().Trim().Length == 0)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeFixes\CodeFixServiceTests.cs (1)
923if (text == null || text.Lines.Count == 0)
EditorAdapter\TextSnapshotImplementationTest.cs (2)
32Assert.Equal(tuple.Item1.LineCount, text.Lines.Count); 64Assert.Equal(2, lines.Count);
Microsoft.CodeAnalysis.Features (8)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
741var lastLine = lines.Count > 0 ? lines[^1] : default; 749if (lines.Count > 1 && lastLine.ToString().Trim().Length == 0)
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
357var nextLineStartsWithDocComment = text.Lines.Count > currentLine.LineNumber + 1 &&
EditAndContinue\ActiveStatementsMap.cs (2)
274if (lineSpan.Start.Line >= lines.Count || lineSpan.End.Line >= lines.Count)
EditAndContinue\EditSession.cs (2)
214var oldLineCount = oldText.Lines.Count; 215var newLineCount = newText.Lines.Count;
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
211for (var i = startLine.LineNumber + 1; i < lines.Count; i++)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\ProtocolConversions.cs (1)
311throw new ArgumentException($"Range={RangeToString(range)}. text.Length={text.Length}. text.Lines.Count={text.Lines.Count}", ex);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (1)
452if (existingData.LineCount == _text.Lines.Count &&
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
ProtocolConversionsTests.cs (1)
254var range = new Range() { Start = new Position(0, 0), End = new Position(sourceText.Lines.Count, 0) };
Microsoft.CodeAnalysis.UnitTests (29)
Text\LargeTextTests.cs (11)
200Assert.Equal(2, data.Lines.Count); 213Assert.Equal(3, data.Lines.Count); 224Assert.Equal(2, data.Lines.Count); 233Assert.Equal(4, data.Lines.Count); 245Assert.Equal(2, data.Lines.Count); 255Assert.Equal(2, data.Lines.Count); 265Assert.Equal(3, data.Lines.Count); 278Assert.Equal(4, data.Lines.Count); 293Assert.Equal(4, data.Lines.Count); 304Assert.Equal(1, data.Lines.Count); 315Assert.Equal(2, data.Lines.Count);
Text\SourceTextTests.cs (1)
47Assert.Equal(1, text.Lines.Count);
Text\StringTextDecodingTests.cs (2)
245Assert.Equal(1, text.Lines.Count); 275Assert.Equal(1, text.Lines.Count);
Text\StringTextTest.cs (8)
47Assert.Equal(1, data.Lines.Count); 62Assert.Equal(1, data.Lines.Count); 153Assert.Equal(2, data.Lines.Count); 166Assert.Equal(3, data.Lines.Count); 177Assert.Equal(2, data.Lines.Count); 186Assert.Equal(4, data.Lines.Count); 197Assert.Equal(1, data.Lines.Count); 208Assert.Equal(2, data.Lines.Count);
Text\StringTextTests_Default.cs (6)
42Assert.Equal(1, data.Lines.Count); 59Assert.Equal(2, data.Lines.Count); 72Assert.Equal(3, data.Lines.Count); 82Assert.Equal(2, data.Lines.Count); 91Assert.Equal(3, data.Lines.Count); 100Assert.Equal(2, data.Lines.Count);
Text\TextChangeTests.cs (1)
208Assert.Equal(1, newText.Lines.Count);
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\CommandLineDiagnosticFormatter.vb (1)
115If linenumber >= text.Lines.Count Then
Microsoft.CodeAnalysis.Workspaces (8)
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (2)
100for (startLine = 0; startLine < text.Lines.Count; startLine++) 108for (endLine = text.Lines.Count - 1; endLine > startLine; endLine--)
Shared\Extensions\FileLinePositionSpanExtensions.cs (5)
41if (lines.Count == 0) 57else if (startLine >= lines.Count) 60startLine = lines.Count - 1; 70else if (endLine >= lines.Count) 73endLine = lines.Count - 1;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
174if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Microsoft.VisualStudio.LanguageServices (2)
CodeLens\RemoteCodeLensReferencesService.cs (1)
245if (index < 0 || index >= lines.Count)
FindReferences\Entries\DocumentSpanEntry.cs (1)
237var lastLineNumber = Math.Min(sourceText.Lines.Count - 1, lineNumber + AdditionalLineCountPerSide);