157 references to Line
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (1)
184LineNumber = linePosSpan.StartLinePosition.Line + 1;
dotnet (2)
_generated\17\RunFileApiJsonSerializerContext.LinePosition.g.cs (2)
60Getter = static obj => ((global::Microsoft.CodeAnalysis.Text.LinePosition)obj).Line, 102writer.WriteNumber(PropName_Line, ((global::Microsoft.CodeAnalysis.Text.LinePosition)value).Line);
dotnet-format (2)
FileChange.cs (1)
21LineNumber = changePosition.Line + 1;
Logging\ILoggerExtensions.cs (1)
20=> LogIssue(logger, document, diagnostic.Severity.ToString().ToLower(), diagnostic.Id, diagnosticPosition.Line + 1, diagnosticPosition.Character + 1, diagnostic.GetMessage(), changesAreErrors);
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
469Assert.Equal(lineNumbers[i], location.GetLineSpan().StartLinePosition.Line);
Microsoft.CodeAnalysis (26)
CodeGen\SequencePointList.cs (4)
177int startLine = (fileLinePositionSpan.StartLinePosition.Line == -1) ? 0 : fileLinePositionSpan.StartLinePosition.Line + 1; 178int endLine = (fileLinePositionSpan.EndLinePosition.Line == -1) ? 0 : fileLinePositionSpan.EndLinePosition.Line + 1;
CommandLine\SarifErrorLogger.cs (2)
50_writer.Write("startLine", span.StartLinePosition.Line + 1); 52_writer.Write("endLine", span.EndLinePosition.Line + 1);
Diagnostic\DiagnosticFormatter.cs (1)
79return string.Format("({0},{1})", span.Start.Line + 1, span.Start.Character + 1);
Diagnostic\Location.cs (2)
115result += "(" + pos.Path + "@" + (pos.StartLinePosition.Line + 1) + ":" + (pos.StartLinePosition.Character + 1) + ")"; 144result += "(" + pos.Path + "@" + (pos.StartLinePosition.Line + 1) + ":" + (pos.StartLinePosition.Character + 1) + ")";
Syntax\LineDirectiveMap.cs (6)
53var entry = FindEntry(unmappedStartPos.Line); 73int mappedLine = unmapped.Line - entry.UnmappedLine + entry.MappedLine; 83if (unmappedStartPos.Line == entry.UnmappedLine && 96unmapped.Line - entry.UnmappedLine + entry.MappedSpan.Start.Line, 97unmapped.Line == entry.UnmappedLine ?
Syntax\SyntaxTree.cs (1)
323return GetMappedLineSpan(span).StartLinePosition.Line + 1;
Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
Text\LinePosition.cs (4)
107return other.Line == this.Line && other.Character == this.Character; 124return Hash.Combine(Line, Character); 133return Line + "," + Character;
Text\TextLineCollection.cs (4)
65if (position.Line >= this.Count) 67throw new ArgumentOutOfRangeException(nameof(position.Line), string.Format(CodeAnalysisResources.LineCannotBeGreaterThanEnd, position.Line, this.Count)); 70return this[position.Line].Start + position.Character;
Microsoft.CodeAnalysis.Analyzers (4)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (2)
81long delta = linePosition.EndLinePosition.Line - linePosition.StartLinePosition.Line;
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (2)
81long delta = linePosition.EndLinePosition.Line - linePosition.StartLinePosition.Line;
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
77text.Lines[diagnosticLinePositionSpan.Start.Line].Start, 78text.Lines[diagnosticLinePositionSpan.End.Line].End);
Microsoft.CodeAnalysis.CSharp (11)
CommandLine\CommandLineDiagnosticFormatter.cs (3)
33span.Start.Line + 1, 35span.End.Line + 1, 41span.Start.Line + 1,
Compilation\CSharpSemanticModel.cs (1)
5290var lineNumberOneIndexed = lineSpan.Line + 1;
Emitter\Model\PEModuleBuilder.cs (2)
471span.StartLinePosition.Line, 473span.EndLinePosition.Line,
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
509span.StartLinePosition.Line, 511span.EndLinePosition.Line,
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1308diagnostics.Add(ErrorCode.ERR_InterceptorMustReferToStartOfTokenPosition, attributeLocation, referencedToken.Text, linePositionZeroBased.Line + 1, linePositionZeroBased.Character + 1);
Syntax\CSharpLineDirectiveMap.cs (2)
192var index = FindEntryIndex(unmappedPos.Line); 246var entry = FindEntry(unmappedStartPos.Line);
Microsoft.CodeAnalysis.CSharp.Features (5)
Structure\Providers\ArgumentListStructureProvider.cs (2)
37var start = text.Lines.GetLinePosition(openToken.SpanStart).Line; 38var end = text.Lines.GetLinePosition(closeToken.SpanStart).Line;
Structure\Providers\ParameterListStructureProvider.cs (2)
37var start = text.Lines.GetLinePosition(openToken.SpanStart).Line; 38var end = text.Lines.GetLinePosition(closeToken.SpanStart).Line;
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (1)
244return $"{Path}({Text.Lines.GetLinePositionSpan(span).Start.Line + 1})";
Microsoft.CodeAnalysis.Features (37)
BraceCompletion\AbstractBraceCompletionService.cs (1)
65var caretLocation = new LinePosition(originalOpeningLinePosition.Line, originalOpeningLinePosition.Character + 1);
CodeLens\CodeLensReferencesService.cs (2)
152startLinePosition.Line, 272result.LinePositionSpan.Start.Line,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
2350var oldStartLine = oldMappedSpan.Span.Start.Line; 2351var newStartLine = newMappedSpan.Span.Start.Line;
EditAndContinue\ActiveStatementsMap.cs (12)
251var lineDifference = unmappedSection.Start.Line - mappedSection.Start.Line; 252var unmappedStartLine = mappedSpan.Start.Line + lineDifference; 253var unmappedEndLine = mappedSpan.End.Line + lineDifference; 255var unmappedStartColumn = (mappedSpan.Start.Line == mappedSection.Start.Line) 259var unmappedEndColumn = (mappedSpan.End.Line == mappedSection.Start.Line) 268if (lineSpan.Start.Line >= lines.Count || lineSpan.End.Line >= lines.Count) 274var start = lines[lineSpan.Start.Line].Start + lineSpan.Start.Character; 275var end = lines[lineSpan.End.Line].Start + lineSpan.End.Character;
EditAndContinue\EditSession.cs (8)
1760Debug.Assert(newSpan.Span.End.Line - newSpan.Span.Start.Line == baseSpan.Span.End.Line - baseSpan.Span.Start.Line); 1761Debug.Assert(region.OldSpan.Span.End.Line - region.OldSpan.Span.Start.Line == baseSpan.Span.End.Line - baseSpan.Span.Start.Line);
EditAndContinue\Utilities\Extensions.cs (6)
21=> new(new LinePosition(span.Start.Line + lineDelta, span.Start.Character), new LinePosition(span.End.Line + lineDelta, span.End.Character)); 27=> newSpan.Start.Line - oldSpan.Start.Line; 36=> new(span.Start.Line, span.Start.Character, span.End.Line, span.End.Character);
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
77text.Lines[diagnosticLinePositionSpan.Start.Line].Start, 78text.Lines[diagnosticLinePositionSpan.End.Line].End);
Structure\BlockSpan.cs (4)
134var startLine = lines.GetLinePosition(this.TextSpan.Start).Line; 135var otherStartLine = lines.GetLinePosition(other.Value.TextSpan.Start).Line; 139var endLine = lines.GetLinePosition(this.TextSpan.End).Line; 140var otherEndLine = lines.GetLinePosition(other.Value.TextSpan.End).Line;
Microsoft.CodeAnalysis.Razor.Compiler (24)
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (5)
935location.Line, 938endLocation.Line - location.Line, 948location.Line, 964location.Line,
Language\DefaultTagHelperResolutionPhase.cs (6)
852new SourceSpan(filePath, exprStart, atLoc.Line, atLoc.Character, 1, 0, atLoc.Character + 1))); 863new SourceSpan(filePath, exprStart, loc.Line, loc.Character, exprLength, 0, loc.Character + exprLength))); 884new SourceSpan(filePath, parenStart, openLoc.Line, openLoc.Character, 1, 0, openLoc.Character + 1))); 896new SourceSpan(filePath, innerStart, innerLoc.Line, innerLoc.Character, innerLen, 0, innerLoc.Character + innerLen))); 904new SourceSpan(filePath, closePos, closeLoc.Line, closeLoc.Character, 1, 0, closeLoc.Character + 1))); 921expr.Source = expressionSource.WithLineIndex(exprLoc.Line)
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (3)
1342expr.Source = new SourceSpan(exprSource.FilePath, contentStart, openLoc.Line, openLoc.Character, contentLength, 0, closeLoc.Character + 1); 1351contentLocation.Line, 1456emptySpan = new SourceSpan(nextSrc.FilePath, nextSrc.AbsoluteIndex, loc.Line, loc.Character, 0, 0, loc.Character);
Language\Legacy\RoslynCSharpTokenizer.cs (2)
592lineIndex: linePosition.Line, 605lineIndex: linePosition.Line,
Language\SourceLocation.cs (1)
44: this(filePath, absoluteIndex, linePosition.Line, linePosition.Character)
Language\SpanComputer.cs (3)
113var lineCount = endLinePosition.Line - startLinePosition.Line; 115return new SourceSpan(source.FilePath, absoluteIndex: start, startLinePosition.Line, startLinePosition.Character, length, lineCount, endLinePosition.Character);
Language\Syntax\SyntaxNodeExtensions.cs (4)
66lastLocation.Line + (endsWithLineBreak ? 1 : 0), 101lastLocation.Line + (endsWithLineBreak ? 1 : 0), 122var lineCount = endLocation.Line - location.LineIndex; 130var lineCount = endLocation.Line - location.LineIndex;
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (2)
81long delta = linePosition.EndLinePosition.Line - linePosition.StartLinePosition.Line;
Microsoft.CodeAnalysis.VisualBasic (7)
Emit\PEModuleBuilder.vb (2)
287span.StartLinePosition.Line, 289span.EndLinePosition.Line,
Errors\DiagnosticFormatter.vb (1)
19Return "(" & (span.Start.Line + 1).ToString(Globalization.CultureInfo.InvariantCulture) & ") "
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (2)
462span.StartLinePosition.Line, 464span.EndLinePosition.Line,
Syntax\VisualBasicLineDirectiveMap.vb (2)
149Dim index As Integer = FindEntryIndex(unmappedPos.Line) 213Dim index As Integer = FindEntryIndex(unmappedStartPos.Line)
Microsoft.CodeAnalysis.VisualBasic.Features (4)
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.MoveToLineCodeAction.vb (1)
36Dim lineToMove = _token.GetLocation().GetLineSpan().StartLinePosition.Line
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (3)
106destinationLine = root.Options.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1 144destinationLine = root.Imports.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1 146destinationLine = root.Options.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1
Microsoft.CodeAnalysis.Workspaces (4)
Shared\Extensions\FileLinePositionSpanExtensions.cs (2)
43var startLine = span.Start.Line; 44var endLine = span.End.Line;
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
Microsoft.DotNet.ProjectTools (2)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (1)
245return $"{Path}({Text.Lines.GetLinePositionSpan(span).Start.Line + 1})";
VirtualProjectBuilder.cs (1)
271(text, path, textSpan, message, _) => errorReporter(path, text.Lines.GetLinePositionSpan(textSpan).Start.Line + 1, message),
Microsoft.Gen.ComplianceReports (3)
Parser.cs (3)
126ci.SourceLine = fileLine.StartLinePosition.Line + 1; 187ci.SourceLine = fileLine.StartLinePosition.Line + 1; 223SourceLine = fileLine.StartLinePosition.Line + 1,
Microsoft.Gen.MetadataExtractor (3)
src\Generators\Microsoft.Gen.ComplianceReports\Parser.cs (3)
126ci.SourceLine = fileLine.StartLinePosition.Line + 1; 187ci.SourceLine = fileLine.StartLinePosition.Line + 1; 223SourceLine = fileLine.StartLinePosition.Line + 1,
Microsoft.Maui.Controls.BindingSourceGen (1)
BindingInvocationDescription.cs (1)
33 return new SimpleLocation(FilePath, LineSpan.Start.Line + 1, LineSpan.Start.Character + 1);
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
77var line = text.Lines[position.Line]; 79message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (2)
81long delta = linePosition.EndLinePosition.Line - linePosition.StartLinePosition.Line;
SuperFileCheck (2)
Program.cs (2)
377return methodDecl.GetLocation().GetLineSpan().StartLinePosition.Line; 381return leadingTrivia[0].GetLocation().GetLineSpan().StartLinePosition.Line;