Implemented interface member:
3 overrides of Count
Microsoft.CodeAnalysis (3)
Text\CompositeText.cs (1)
466public override int Count => _lineCount;
Text\SourceText.cs (1)
1025public override int Count => _lineStarts.Count;
Text\SubText.cs (1)
195public override int Count => _lineCount;
51 references to Count
dotnet-format (2)
Formatters\EndOfLineFormatter.cs (1)
37for (var lineIndex = 0; lineIndex < newSourceText.Lines.Count; lineIndex++)
Formatters\FinalNewlineFormatter.cs (1)
50while (sourceText.Lines.Count > 1 && hasFinalNewline)
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
173if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Microsoft.AspNetCore.App.Analyzers (2)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (2)
212var lastLineExclusive = tokenIncludeDelimiters ? tokenSourceText.Lines.Count - 1 : tokenSourceText.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)); 526Debug.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.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
173if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
173if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
173if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
212for (var i = startLine.LineNumber + 1; i < lines.Count; i++)
Microsoft.CodeAnalysis.CSharp (2)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1084var referencedLineCount = referencedLines.Count; 1267var referencedLineCount = referencedLines.Count;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
199var lastLineExclusive = tokenIncludeDelimiters ? tokenSourceText.Lines.Count - 1 : tokenSourceText.Lines.Count;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
122for (var line = semicolonLine + 1; line < text.Lines.Count; line++)
Microsoft.CodeAnalysis.CSharp.Features (4)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
300for (int i = 1, n = text.Lines.Count; i < n; i++)
LineSeparators\CSharpLineSeparatorService.cs (1)
332if (line == syntaxTree.GetText(cancellationToken).Lines.Count - 1)
src\roslyn\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.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
199var lastLineExclusive = tokenIncludeDelimiters ? tokenSourceText.Lines.Count - 1 : tokenSourceText.Lines.Count;
Microsoft.CodeAnalysis.Features (9)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
741var lastLine = lines.Count > 0 ? lines[^1] : default; 749if (lines.Count > 1 && lastLine.ToString().Trim().Length == 0)
CodeLens\CodeLensReferencesService.cs (1)
320if (index < 0 || index >= lines.Count)
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
391var nextLineStartsWithDocComment = text.Lines.Count > currentLine.LineNumber + 1 &&
EditAndContinue\ActiveStatementsMap.cs (2)
268if (lineSpan.Start.Line >= lines.Count || lineSpan.End.Line >= lines.Count)
EditAndContinue\EditSession.cs (2)
209var oldLineCount = oldText.Lines.Count; 210var newLineCount = newText.Lines.Count;
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
212for (var i = startLine.LineNumber + 1; i < lines.Count; i++)
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\Legacy\SeekableTextReader.cs (1)
126var lineNumber = SourceText.Lines.Count - 1;
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
173if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\CommandLineDiagnosticFormatter.vb (1)
115If linenumber >= text.Lines.Count Then
Microsoft.CodeAnalysis.Workspaces (8)
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (2)
127for (startLine = 0; startLine < text.Lines.Count; startLine++) 135for (endLine = text.Lines.Count - 1; endLine > startLine; endLine--)
Shared\Extensions\FileLinePositionSpanExtensions.cs (5)
40if (lines.Count == 0) 56else if (startLine >= lines.Count) 59startLine = lines.Count - 1; 69else if (endLine >= lines.Count) 72endLine = lines.Count - 1;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
173if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
173if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count)
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
199var lastLineExclusive = tokenIncludeDelimiters ? tokenSourceText.Lines.Count - 1 : tokenSourceText.Lines.Count;