186 references to Line
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (1)
184LineNumber = linePosSpan.StartLinePosition.Line + 1;
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
469Assert.Equal(lineNumbers[i], location.GetLineSpan().StartLinePosition.Line);
Microsoft.AspNetCore.Analyzer.Testing (3)
Assert.cs (3)
17if (actualLinePosition.Line > 0) 19if (actualLinePosition.Line + 1 != expected.Line) 24$"Expected diagnostic to be on line \"{expected.Line}\" was actually on line \"{actualLinePosition.Line + 1}\"");
Microsoft.AspNetCore.Components.Analyzers.Tests (4)
Verifiers\DiagnosticVerifier.cs (4)
203if (actualLinePosition.Line > 0) 205if (actualLinePosition.Line + 1 != expected.Line) 211expected.Line, actualLinePosition.Line + 1, FormatDiagnostics(analyzer, diagnostic))); 268linePosition.Line + 1,
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (4)
Verifiers\DiagnosticVerifier.cs (4)
203if (actualLinePosition.Line > 0) 205if (actualLinePosition.Line + 1 != expected.Line) 211expected.Line, actualLinePosition.Line + 1, FormatDiagnostics(analyzer, diagnostic))); 268linePosition.Line + 1,
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\Endpoint.cs (1)
168return (filePath, lineSpan.StartLinePosition.Line + 1, lineSpan.StartLinePosition.Character + 1);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
CompilationFailedExceptionFactory.cs (2)
124mappedLineSpan.StartLinePosition.Line + 1, 126mappedLineSpan.EndLinePosition.Line + 1,
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)
322return GetMappedLineSpan(span).StartLinePosition.Line + 1;
Syntax\SyntaxTreeExtensions.cs (2)
72var line = text.Lines[position.Line]; 74message = $"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.CodeStyle (2)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
72var line = text.Lines[position.Line]; 74message = $"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\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
71text.Lines[diagnosticLinePositionSpan.Start.Line].Start, 72text.Lines[diagnosticLinePositionSpan.End.Line].End);
Microsoft.CodeAnalysis.CSharp (10)
CommandLine\CommandLineDiagnosticFormatter.cs (3)
33span.Start.Line + 1, 35span.End.Line + 1, 41span.Start.Line + 1,
Emitter\Model\PEModuleBuilder.cs (2)
461span.StartLinePosition.Line, 463span.EndLinePosition.Line,
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
509span.StartLinePosition.Line, 511span.EndLinePosition.Line,
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1315diagnostics.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 (2)
Structure\Providers\ArgumentListStructureProvider.cs (2)
37var start = text.Lines.GetLinePosition(openToken.SpanStart).Line; 38var end = text.Lines.GetLinePosition(closeToken.SpanStart).Line;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\FieldInitializerBindingTests.cs (1)
282var initValueLineNumber = syntaxTree.GetLineSpan(initValueSyntax.Span).StartLinePosition.Line;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (18)
Diagnostics\LineSpanDirectiveTests.cs (2)
498if (position.Line < lines.Count) 500var line = lines[position.Line];
Diagnostics\LocationsTests.cs (14)
60Assert.Equal(expectedStartLine, mappedSpan.StartLinePosition.Line); 62Assert.Equal(expectedEndLine, mappedSpan.EndLinePosition.Line); 96Assert.Equal(2, flpsX.StartLinePosition.Line); 98Assert.Equal(2, flpsX.EndLinePosition.Line); 103Assert.Equal(19, flpsX.StartLinePosition.Line); 105Assert.Equal(19, flpsX.EndLinePosition.Line); 110Assert.Equal(2, flpsXToCloseBrace.StartLinePosition.Line); 112Assert.Equal(3, flpsXToCloseBrace.EndLinePosition.Line); 117Assert.Equal(19, flpsXToCloseBrace.StartLinePosition.Line); 119Assert.Equal(20, flpsXToCloseBrace.EndLinePosition.Line); 573Assert.Equal(0, lineSpan.StartLinePosition.Line); 575Assert.Equal(0, lineSpan.EndLinePosition.Line); 601Assert.Equal(0, lineSpan.StartLinePosition.Line); 603Assert.Equal(0, lineSpan.EndLinePosition.Line);
LexicalAndXml\PreprocessorTests.cs (1)
3561Assert.Equal(99, lineSpan.StartLinePosition.Line); // zero-based line number
Parsing\ParserRegressionTests.cs (1)
168var line = endLinePosition.Line;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
DiagnosticTestUtilities.cs (1)
119Line = lineSpan.IsValid ? lineSpan.StartLinePosition.Line + 1 : 0,
Microsoft.CodeAnalysis.EditorFeatures.Text (2)
Shared\Extensions\ITextSnapshotExtensions.cs (2)
36GetPosition(snapshot, span.Start.Line, span.Start.Character), 37GetPosition(snapshot, span.End.Line, span.End.Character));
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
Peek\PeekHelpers.cs (4)
20var label = string.Format("{0} - ({1}, {2})", fileName, identifierLocation.Start.Line + 1, identifierLocation.Start.Character + 1); 38startLine: entityOfInterestSpan.Start.Line, 40endLine: entityOfInterestSpan.End.Line, 42idLine: identifierLocation.Start.Line,
Microsoft.CodeAnalysis.Features (25)
CodeLens\CodeLensReferencesService.cs (1)
156startLinePosition.Line,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
2173var oldStartLine = oldMappedSpan.Span.Start.Line; 2174var newStartLine = newMappedSpan.Span.Start.Line;
EditAndContinue\ActiveStatementsMap.cs (12)
257var lineDifference = unmappedSection.Start.Line - mappedSection.Start.Line; 258var unmappedStartLine = mappedSpan.Start.Line + lineDifference; 259var unmappedEndLine = mappedSpan.End.Line + lineDifference; 261var unmappedStartColumn = (mappedSpan.Start.Line == mappedSection.Start.Line) 265var unmappedEndColumn = (mappedSpan.End.Line == mappedSection.Start.Line) 274if (lineSpan.Start.Line >= lines.Count || lineSpan.End.Line >= lines.Count) 280var start = lines[lineSpan.Start.Line].Start + lineSpan.Start.Character; 281var end = lines[lineSpan.End.Line].Start + lineSpan.End.Character;
EditAndContinue\Utilities\Extensions.cs (6)
19=> new(new LinePosition(span.Start.Line + lineDelta, span.Start.Character), new LinePosition(span.End.Line + lineDelta, span.End.Character)); 25=> newSpan.Start.Line - oldSpan.Start.Line; 34=> new(span.Start.Line, span.Start.Character, span.End.Line, span.End.Character);
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.Features.Test.Utilities (1)
EditAndContinue\ActiveStatementTestHelpers.cs (1)
114=> text.Lines[span.Start.Line].ToString().Trim();
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Extensions\ProtocolConversions.cs (1)
344=> new LSP.Position { Line = linePosition.Line, Character = linePosition.Character };
Handler\Diagnostics\DiagnosticsPullCache.cs (1)
119writer.WriteInt32(position.Line);
Handler\FoldingRanges\FoldingRangesHandler.cs (4)
101if (linePositionSpan.Start.Line == linePositionSpan.End.Line) 119StartLine = linePositionSpan.Start.Line, 121EndLine = linePositionSpan.End.Line,
Handler\SemanticTokens\SemanticTokensHelpers.cs (1)
296var lineNumber = linePosition.Line;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (1)
226await testLspServer.InsertTextAsync(document.GetURI(), (lineInfo.Start.Line, lineInfo.Start.Character, text));
SpellCheck\SpellCheckTests.cs (1)
653await testLspServer.InsertTextAsync(document.GetURI(), (lineInfo.Start.Line, lineInfo.Start.Character, text));
Microsoft.CodeAnalysis.Test.Utilities (12)
Diagnostics\CommonDiagnosticAnalyzers.cs (8)
125""startLine"": " + (expectedLineSpan.StartLinePosition.Line + 1) + @", 127""endLine"": " + (expectedLineSpan.EndLinePosition.Line + 1) + @", 202""startLine"": " + (expectedLineSpan.StartLinePosition.Line + 1) + @", 204""endLine"": " + (expectedLineSpan.EndLinePosition.Line + 1) + @", 285""startLine"": " + (expectedLineSpan.StartLinePosition.Line + 1) + @", 287""endLine"": " + (expectedLineSpan.EndLinePosition.Line + 1) + @", 343""startLine"": " + (expectedLineSpan.StartLinePosition.Line + 1) + @", 345""endLine"": " + (expectedLineSpan.EndLinePosition.Line + 1) + @",
Diagnostics\DiagnosticDescription.cs (4)
240public int LocationLine => _startPosition.Value.Line + 1; 436sb.Append(_startPosition.Value.Line + 1); 650int lineDiff = x.Value.Line.CompareTo(y.Value.Line);
Microsoft.CodeAnalysis.UnitTests (7)
LinePositionTests.cs (1)
46Assert.Equal(42, lp.Line);
Text\LargeTextTests.cs (3)
175Assert.Equal(lineNumber, text.Lines.GetLinePosition(p).Line); 183Assert.Equal(lineNumber - 1, text.Lines.GetLinePosition(start - 1).Line); 191Assert.Equal(lineNumber + 1, text.Lines.GetLinePosition(nextPosition).Line);
Text\StringTextTest.cs (3)
128Assert.Equal(lineNumber, text.Lines.GetLinePosition(p).Line); 136Assert.Equal(lineNumber - 1, text.Lines.GetLinePosition(start - 1).Line); 144Assert.Equal(lineNumber + 1, text.Lines.GetLinePosition(nextPosition).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() & ") "
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)
105destinationLine = root.Options.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1 143destinationLine = root.Imports.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1 145destinationLine = root.Options.Last().GetLocation().GetLineSpan().EndLinePosition.Line + 1
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (10)
SymbolsTests\Source\TypeTests.vb (10)
462Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) 498Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) 512Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) 519Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line) 526Assert.Equal(span.StartLinePosition.Line, span.EndLinePosition.Line)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
LocationTests.vb (2)
48Assert.Equal(expectedStartLine, mappedSpan.StartLinePosition.Line) 50Assert.Equal(expectedEndLine, mappedSpan.EndLinePosition.Line)
Microsoft.CodeAnalysis.Workspaces (4)
Shared\Extensions\FileLinePositionSpanExtensions.cs (2)
44var startLine = span.Start.Line; 45var endLine = span.End.Line;
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
72var line = text.Lines[position.Line]; 74message = $"Unexpected difference at offset {index}: Line {position.Line + 1}, Column {position.Character + 1} \"{line.ToString()}\" (Found: [{found}] Expected: [{expected}])";
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
FindReferencesTests.cs (1)
644var line = location.GetLineSpan().StartLinePosition.Line;
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.VisualStudio.LanguageServices (17)
CallHierarchy\CallHierarchyDetail.cs (4)
34EndLine = location.GetLineSpan().EndLinePosition.Line; 37StartLine = location.GetLineSpan().StartLinePosition.Line; 44var start = location.SourceTree.GetText().Lines[lineSpan.StartLinePosition.Line].Start; 45var end = location.SourceTree.GetText().Lines[lineSpan.EndLinePosition.Line].End;
Diagnostics\VisualStudioVenusSpanMappingService.cs (7)
104if (!TryAdjustSpanIfNeededForVenus(documentId, originalLineInfo.StartLinePosition.Line, originalLineInfo.StartLinePosition.Character, out var startLineColumn)) 107startLineColumn = new MappedSpan(originalLineInfo.StartLinePosition.Line, originalLineInfo.StartLinePosition.Character, mappedLineInfo.StartLinePosition.Line, mappedLineInfo.StartLinePosition.Character); 111if (!TryAdjustSpanIfNeededForVenus(documentId, originalLineInfo.EndLinePosition.Line, originalLineInfo.EndLinePosition.Character, out var endLineColumn)) 114endLineColumn = new MappedSpan(originalLineInfo.EndLinePosition.Line, originalLineInfo.EndLinePosition.Character, mappedLineInfo.EndLinePosition.Line, mappedLineInfo.EndLinePosition.Character); 218return TryAdjustSpanIfNeededForVenus(documentId, adjustedPosition.Line, adjustedPosition.Character, out mappedSpan);
FindReferences\VisualStudioDefinitionsAndReferencesFactory.cs (2)
50var sourceLine = GetSourceLine_MustCallOnUIThread(filePath, linePosition.Line).Trim(' ', '\t'); 53var formatted = $"{filePath} - ({linePosition.Line + 1}, {linePosition.Character + 1}) : {sourceLine}";
Progression\GraphBuilder.cs (2)
791new Position(span.Start.Line, span.Start.Character), 792new Position(span.End.Line, span.End.Character));
Progression\GraphQueries\IsUsedByGraphQuery.cs (2)
56var lineText = location.SourceTree.GetText(cancellationToken).Lines[span.StartLinePosition.Line].ToString(); 64span.StartLinePosition.Line + 1,