294 instantiations of LinePosition
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (6)
CompilerFailedExceptionFactoryTest.cs (6)
243new LinePositionSpan(new LinePosition(10, 1), new LinePosition(10, 2)))), 249new LinePositionSpan(new LinePosition(1, 2), new LinePosition(3, 4)))), 255new LinePositionSpan(new LinePosition(30, 5), new LinePosition(40, 12)))),
Microsoft.CodeAnalysis (10)
Diagnostic\XmlLocation.cs (2)
22LinePosition start = new LinePosition(lineNumber, columnNumber); 23LinePosition end = new LinePosition(lineNumber, columnNumber + 1);
Syntax\LineDirectiveMap.cs (7)
74return (mappedLine == -1) ? new LinePosition(unmapped.Character) : new LinePosition(mappedLine, unmapped.Character); 95return new LinePosition( 239new LinePosition(entry.UnmappedLine, character: 0), 240new LinePosition(unmappedEndLine, lineLength)); 260new LinePosition(entry.MappedLine, character: 0), 261new LinePosition(entry.MappedLine + unmappedEndLine - entry.UnmappedLine, lineLength));
Text\TextLineCollection.cs (1)
49return new LinePosition(line.LineNumber, position - line.Start);
Microsoft.CodeAnalysis.CSharp (1)
Syntax\CSharpLineDirectiveMap.cs (1)
166position = new LinePosition(line, isEnd ? character + 1 : character);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
50=> TestHelpers.Diagnostic(IDEDiagnosticIds.RemoveUnnecessaryParenthesesDiagnosticId, text, startLocation: new LinePosition(line, column));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (12)
EditAndContinue\ActiveStatementTrackingServiceTests.cs (8)
33var span11 = new LinePositionSpan(new LinePosition(0, 10), new LinePosition(0, 15)); 34var span12 = new LinePositionSpan(new LinePosition(0, 20), new LinePosition(0, 25)); 35var span21 = new LinePositionSpan(new LinePosition(0, 11), new LinePosition(0, 16)); 36var span22 = new LinePositionSpan(new LinePosition(0, 21), new LinePosition(0, 26));
TaskList\NoCompilationTaskListTests.cs (4)
67Span: new FileLinePositionSpan("dummy", new LinePosition(0, 3), new LinePosition(0, 3)), 68MappedSpan: new FileLinePositionSpan("dummy", new LinePosition(0, 3), new LinePosition(0, 3)))));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
50=> TestHelpers.Diagnostic(IDEDiagnosticIds.RemoveUnnecessaryParenthesesDiagnosticId, text, startLocation: new LinePosition(line, column));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (16)
Diagnostics\LocationsTests.cs (16)
316Assert.Equal(flps, new FileLinePositionSpan("c:\\goo.cs", new LinePosition(8, 13), new LinePosition(8, 13))); 334Assert.Equal(flps, new FileLinePositionSpan("c:\\goo.cs", new LinePosition(8, 13), new LinePosition(8, 13))); 354Assert.Equal(flps, new FileLinePositionSpan("c:\\goo.cs", new LinePosition(8, 13), new LinePosition(8, 13))); 379Assert.Equal(flps, new FileLinePositionSpan("c:\\goo.cs", new LinePosition(8, 15), new LinePosition(8, 19))); 419Assert.Equal(span, new FileLinePositionSpan("", new LinePosition(1, 9), new LinePosition(1, 9))); 504Location location = Location.Create("test.txt", new TextSpan(), new LinePositionSpan(new LinePosition(2, 1), new LinePosition(3, 1))); 515var lineSpan = new LinePositionSpan(new LinePosition(2, 1), new LinePosition(3, 1)); 517var mappedLineSpan = new LinePositionSpan(new LinePosition(3, 2), new LinePosition(4, 2));
Microsoft.CodeAnalysis.EditorFeatures (3)
Navigation\IDocumentNavigationServiceExtensions.cs (1)
87var linePosition = new LinePosition(lineNumber, offset);
Shared\Extensions\SnapshotSpanExtensions.cs (2)
30return new LinePositionSpan(new LinePosition(startLine, startChar), new LinePosition(endLine, endChar));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
69private static readonly LinePositionSpan s_mappedLinePosition = new LinePositionSpan(new LinePosition(0, 0), new LinePosition(0, 5));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (1)
Utilities\MockSymbolNavigationServiceProvider.vb (1)
69Return Task.FromResult(Of (filePath As String, linePosition As LinePosition)?)((Me.NavigationFilePathReturnValue, New LinePosition(Me.NavigationLineNumberReturnValue, Me.NavigationCharOffsetReturnValue)))
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
170return new LinePosition(textLine.LineNumber, position - textLine.Start);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
952=> Task.FromResult(ImmutableArray.Create(Diagnostic.Create(s_syntaxRule, Location.Create(document.FilePath, TextSpan.FromBounds(0, 0), new LinePositionSpan(new LinePosition(0, 0), new LinePosition(0, 0))))));
Diagnostics\DiagnosticDataTests.cs (7)
125location: new DiagnosticDataLocation(new("originalFile1", new(startLine, startColumn), new(endLine, endColumn)), document.Id), 145new(additionalDocument.Name, new(0, 0), new(0, 1)), additionalDocument.Id); 191new(document.FilePath, new(3, 10), new(3, 11)), documentId); 239new(secondDocument.Name, new(0, 0), new(0, 1)), secondDocument.Id);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (5)
CodeDefinitionWindow\CrossLanguageCodeDefinitionWindowTests.vb (1)
120New LinePosition(1, 3))
Diagnostics\DiagnosticProviderTests.vb (4)
358New FileLinePositionSpan(originalFile, New LinePosition(originalLine, originalColumn), New LinePosition(originalLine, originalColumn)), 360If(mappedFile Is Nothing, Nothing, New FileLinePositionSpan(mappedFile, New LinePosition(mappedLine, mappedColumn), New LinePosition(mappedLine, mappedColumn)))),
Microsoft.CodeAnalysis.Features (6)
EditAndContinue\ActiveStatementsMap.cs (2)
269return new(new(unmappedStartLine, unmappedStartColumn), new(unmappedEndLine, unmappedEndColumn));
EditAndContinue\Utilities\Extensions.cs (4)
19=> new(new LinePosition(span.Start.Line + lineDelta, span.Start.Character), new LinePosition(span.End.Line + lineDelta, span.End.Character)); 31=> new(new(span.StartLine, span.StartColumn), new(span.EndLine, span.EndColumn));
Microsoft.CodeAnalysis.Features.UnitTests (50)
EditAndContinue\ActiveStatementsMapTests.cs (30)
33var span = new LinePositionSpan(new(sl, sc), new(el, ec)); 35new LinePositionSpan(new(3, 0), new(3, 1)), 36new LinePositionSpan(new(3, 5), new(3, 6)), 37new LinePositionSpan(new(4, 4), new(4, 18)), 38new LinePositionSpan(new(5, 1), new(5, 2)), 39new LinePositionSpan(new(5, 2), new(5, 8)), 40new LinePositionSpan(new(19, 0), new(19, 42))); 68var span = new LinePositionSpan(new(sl, sc), new(el, ec)); 70new LinePositionSpan(new(5, 1), new(5, 2)), 71new LinePositionSpan(new(5, 1), new(5, 8)), 72new LinePositionSpan(new(6, 4), new(6, 18))); 81var span = new LinePositionSpan(new(sl, sc), new(el, ec)); 83new LinePositionSpan(new(5, 1), new(5, 2)), 84new LinePositionSpan(new(5, 1), new(5, 3)), 85new LinePositionSpan(new(5, 1), new(5, 8)));
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (14)
431var activeLineSpan = new LinePositionSpan(new(0, 0), new(0, 1)); 4034new ActiveStatementSpan(new ActiveStatementId(0), new LinePositionSpan(new(4, 41), new(4, 42)), ActiveStatementFlags.MethodUpToDate | ActiveStatementFlags.LeafFrame), 4131var expectedSpanG1 = new LinePositionSpan(new LinePosition(3, 41), new LinePosition(3, 42)); 4132var expectedSpanF1 = new LinePositionSpan(new LinePosition(8, 14), new LinePosition(8, 18)); 4144var expectedSpanG2 = new LinePositionSpan(new LinePosition(3, 41), new LinePosition(3, 42)); 4145var expectedSpanF2 = new LinePositionSpan(new LinePosition(9, 14), new LinePosition(9, 18)); 4242var expectedSpanG1 = new LinePositionSpan(new LinePosition(3, 41), new LinePosition(3, 42));
EditAndContinue\EmitSolutionUpdateResultsTests.cs (2)
123new DiagnosticDataLocation(new(sourcePath, new(0, 1), new(0, 5)), document.Id),
EditAndContinue\RemoteEditAndContinueServiceTests.cs (4)
92var span1 = new LinePositionSpan(new LinePosition(1, 2), new LinePosition(1, 5)); 111new ActiveStatementSpan(new ActiveStatementId(0), new LinePositionSpan(new LinePosition(1, 2), new LinePosition(3, 4)), ActiveStatementFlags.NonLeafFrame, documentId));
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\ProtocolConversions.cs (1)
293=> new(position.Line, position.Character);
Handler\RelatedDocuments\RelatedDocumentsHandler.cs (1)
64? new LinePosition(0, 0)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (16)
Diagnostics\AdditionalFileDiagnosticsTests.cs (2)
139location: Location.Create(context.AdditionalFile.Path, Text.TextSpan.FromBounds(0, 0), new Text.LinePositionSpan(new Text.LinePosition(0, 0), new Text.LinePosition(0, 0))), "args"));
Diagnostics\DiagnosticsPullCacheTests.cs (2)
125new DiagnosticDataLocation(new FileLinePositionSpan(context.Document!.FilePath!, new Text.LinePosition(0, 0), new Text.LinePosition(0, 0))))]);
SemanticTokens\SemanticTokensRangeTests.cs (12)
124new LinePositionSpan(new LinePosition(12, 0), new LinePosition(13, 0)), 125new LinePositionSpan(new LinePosition(29, 0), new LinePosition(30, 0)), 181ImmutableArray<LinePositionSpan> spans = [new LinePositionSpan(new LinePosition(1, 0), new LinePosition(2, 0))]; 231ImmutableArray<LinePositionSpan> spans = [new LinePositionSpan(new LinePosition(0, 0), new LinePosition(4, 0))]; 290ImmutableArray<LinePositionSpan> spans = [new LinePositionSpan(new LinePosition(0, 0), new LinePosition(9, 0))]; 371ImmutableArray<LinePositionSpan> spans = [new LinePositionSpan(new LinePosition(0, 0), new LinePosition(9, 0))];
Microsoft.CodeAnalysis.Test.Utilities (3)
Diagnostics\DiagnosticDescription.cs (1)
225return new DiagnosticDescription(_code, _isWarningAsError, _squiggledText, _arguments, new LinePosition(line - 1, column - 1), _syntaxPredicate, _argumentOrderDoesNotMatter, _errorCodeType, _defaultSeverityOpt, _effectiveSeverityOpt, _isSuppressed);
Metadata\ILValidation.cs (2)
421var lineSpan = new LinePositionSpan(new LinePosition(startLine, startColumn), new LinePosition(endLine, endColumn));
Microsoft.CodeAnalysis.UnitTests (129)
FileLinePositionSpanTests.cs (40)
22EqualityUnit.Create(new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(3, 5))) 23.WithNotEqualValues(new FileLinePositionSpan("C:\\Goo.cs", new LinePosition(1, 2), new LinePosition(3, 5))), 24EqualityUnit.Create(new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(3, 5))) 25.WithNotEqualValues(new FileLinePositionSpan("C:\\bar.cs", new LinePosition(1, 2), new LinePosition(3, 5))), 26EqualityUnit.Create(new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(3, 5))) 27.WithNotEqualValues(new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 4), new LinePosition(3, 5))), 28EqualityUnit.Create(new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(3, 5))) 29.WithNotEqualValues(new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(4, 5)))); 38var notUsed = new FileLinePositionSpan(null, new LinePosition(1, 2), new LinePosition(3, 5)); 44var notUsed = new FileLinePositionSpan("C:\\goo.cs", new LinePosition(3, 2), new LinePosition(2, 4)); 50var notUsed = new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(1, 1)); 64var hash1 = new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(3, 5)).GetHashCode(); 65var hash2 = new FileLinePositionSpan("C:\\goo1.cs", new LinePosition(1, 2), new LinePosition(3, 5)).GetHashCode(); 66var hash3 = new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 3), new LinePosition(3, 5)).GetHashCode(); 67var hash4 = new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(6, 5)).GetHashCode(); 68var hash5 = new FileLinePositionSpan("C:\\goo.cs", new LinePosition(2, 2), new LinePosition(6, 5)).GetHashCode(); 69var hash6 = new FileLinePositionSpan("C:\\goo.cs", new LinePosition(2, 2), new LinePosition(6, 8)).GetHashCode(); 83Assert.Equal("C:\\goo.cs: (1,2)-(3,5)", new FileLinePositionSpan("C:\\goo.cs", new LinePosition(1, 2), new LinePosition(3, 5)).ToString()); 84Assert.Equal("\\server\\goo.vb: (1,2)-(3,5)", new FileLinePositionSpan("\\server\\goo.vb", new LinePosition(1, 2), new LinePosition(3, 5)).ToString()); 85Assert.Equal("~\\goo.huh: (1,2)-(3,5)", new FileLinePositionSpan("~\\goo.huh", new LinePosition(1, 2), new LinePosition(3, 5)).ToString());
LineMappingTests.cs (48)
19new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: false)), 20new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: true)), 21new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 2)), hasMappedPath: false)), 22new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(2, 2)), hasMappedPath: false)), 23new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 1), new LinePosition(1, 1)), hasMappedPath: false)), 24new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(1, 0), new LinePosition(1, 1)), hasMappedPath: false)), 25new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("file.cs", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: false)), 26new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), 0, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: false)), 27new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 2)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: false)), 28new LineMapping(new LinePositionSpan(new LinePosition(0, 0), new LinePosition(2, 2)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: false)), 29new LineMapping(new LinePositionSpan(new LinePosition(0, 1), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: false)), 30new LineMapping(new LinePositionSpan(new LinePosition(1, 0), new LinePosition(1, 1)), null, new FileLinePositionSpan("", new LinePositionSpan(new LinePosition(0, 0), new LinePosition(1, 1)), hasMappedPath: false)),
LinePositionTests.cs (41)
22EqualityUnit.Create(new LinePosition(1, 2)).WithEqualValues(new LinePosition(1, 2)), 23EqualityUnit.Create(new LinePosition()).WithEqualValues(new LinePosition()), 24EqualityUnit.Create(new LinePosition(1, 2)).WithNotEqualValues(new LinePosition(1, 3)), 25EqualityUnit.Create(new LinePosition(1, 2)).WithNotEqualValues(new LinePosition(2, 2))); 32() => { var notUsed = new LinePosition(-1, 42); }); 39() => { var notUsed = new LinePosition(42, -1); }); 45var lp = new LinePosition(42, 13); 60var hash1 = new LinePosition(1, 1).GetHashCode(); 61var hash2 = new LinePosition(2, 2).GetHashCode(); 62var hash3 = new LinePosition(1, 2).GetHashCode(); 63var hash4 = new LinePosition(2, 1).GetHashCode(); 78Assert.Equal(0, new LinePosition(1, 1).CompareTo(new LinePosition(1, 1))); 80Assert.Equal(-1, Math.Sign(new LinePosition(1, 1).CompareTo(new LinePosition(1, 2)))); 81Assert.True(new LinePosition(1, 1) < new LinePosition(1, 2)); 83Assert.Equal(-1, Math.Sign(new LinePosition(1, 2).CompareTo(new LinePosition(2, 1)))); 84Assert.True(new LinePosition(1, 2) < new LinePosition(2, 1)); 85Assert.True(new LinePosition(1, 2) <= new LinePosition(1, 2)); 86Assert.True(new LinePosition(1, 2) <= new LinePosition(2, 1)); 88Assert.Equal(+1, Math.Sign(new LinePosition(1, 2).CompareTo(new LinePosition(1, 1)))); 89Assert.True(new LinePosition(1, 2) > new LinePosition(1, 1)); 91Assert.Equal(+1, Math.Sign(new LinePosition(2, 1).CompareTo(new LinePosition(1, 2)))); 92Assert.True(new LinePosition(2, 1) > new LinePosition(1, 2)); 93Assert.True(new LinePosition(2, 1) >= new LinePosition(2, 1)); 94Assert.True(new LinePosition(2, 1) >= new LinePosition(1, 2));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (1)
src\Analyzers\VisualBasic\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryParenthesesTests.vb (1)
30Return TestHelpers.Diagnostic(IDEDiagnosticIds.RemoveUnnecessaryParenthesesDiagnosticId, text, startLocation:=New LinePosition(line, column))
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
CommandLineTests.vb (2)
11138Dim linePosSpan = New LinePositionSpan(New LinePosition(0, 0), New LinePosition(0, span.End))
Microsoft.CodeAnalysis.Workspaces (2)
Shared\Extensions\FileLinePositionSpanExtensions.cs (2)
81var start = new LinePosition(startLine, startColumn); 82var end = new LinePosition(endLine, endColumn);
Microsoft.VisualStudio.LanguageServices (11)
Diagnostics\VisualStudioVenusSpanMappingService.cs (5)
142return new LinePosition(mappedLine, mappedColumn); 233adjustedPosition = new LinePosition(originalLine, originalColumn - 1); 242adjustedPosition = new LinePosition(originalLine - 1, length); 283get { return new LinePosition(_originalLine, _originalColumn); } 288get { return new LinePosition(_mappedLine, _mappedColumn); }
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
265var linePosition = new LinePosition(line, 0);
TaskList\ProjectExternalErrorReporter.cs (4)
187new LinePosition(line, column), 188new LinePosition(line, column)), 249new LinePosition(iStartLine, iStartColumn), 250new LinePosition(iEndLine, iEndColumn)),
Workspace\VisualStudioSymbolNavigationService.cs (1)
239return (filePath, new LinePosition(lineNumber, charOffset));
Microsoft.VisualStudio.LanguageServices.UnitTests (4)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (2)
255location:=New DiagnosticDataLocation(New FileLinePositionSpan("C:\ProjectDiagnostic", New LinePosition(4, 4), New LinePosition(4, 4)), documentId:=Nothing),
Venus\DocumentService_IntegrationTests.vb (2)
109actual.Add((DirectCast(name, String), New LinePosition(CType(line, Integer), CType(position, Integer)), DirectCast(content, String))) 160actual.Add((result.FilePath, New LinePosition(result.LineNumber, result.ColumnNumber), result.ReferenceLineText))
179 references to LinePosition
Microsoft.AspNetCore.Analyzer.Testing (1)
Assert.cs (1)
14var actualLinePosition = actualSpan.StartLinePosition;
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Verifiers\DiagnosticVerifier.cs (2)
200var actualLinePosition = actualSpan.StartLinePosition; 262var linePosition = diagnostics[i].Location.GetLineSpan().StartLinePosition;
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Verifiers\DiagnosticVerifier.cs (2)
200var actualLinePosition = actualSpan.StartLinePosition; 262var linePosition = diagnostics[i].Location.GetLineSpan().StartLinePosition;
Microsoft.CodeAnalysis (59)
Diagnostic\FileLinePositionSpan.cs (6)
50public FileLinePositionSpan(string path, LinePosition start, LinePosition end) 76/// Gets the <see cref="LinePosition"/> of the start of the span. 79public LinePosition StartLinePosition => Span.Start; 82/// Gets the <see cref="LinePosition"/> of the end of the span. 85public LinePosition EndLinePosition => Span.End;
Diagnostic\XmlLocation.cs (2)
22LinePosition start = new LinePosition(lineNumber, columnNumber); 23LinePosition end = new LinePosition(lineNumber, columnNumber + 1);
Syntax\LineDirectiveMap.cs (12)
51var unmappedStartPos = sourceText.Lines.GetLinePosition(span.Start); 52var unmappedEndPos = sourceText.Lines.GetLinePosition(span.End); 58protected FileLinePositionSpan TranslateSpan(in LineMappingEntry entry, string treeFilePath, LinePosition unmappedStartPos, LinePosition unmappedEndPos) 67private static LinePositionSpan TranslateLineDirectiveSpan(in LineMappingEntry entry, LinePosition unmappedStartPos, LinePosition unmappedEndPos) 71static LinePosition translatePosition(in LineMappingEntry entry, LinePosition unmapped) 78private static LinePositionSpan TranslateEnhancedLineDirectiveSpan(in LineMappingEntry entry, LinePosition unmappedStartPos, LinePosition unmappedEndPos) 93static LinePosition translatePosition(in LineMappingEntry entry, LinePosition unmapped)
Syntax\SyntaxTreeExtensions.cs (1)
71var position = text.Lines.GetLinePosition(index);
Text\LinePosition.cs (28)
15public readonly struct LinePosition : IEquatable<LinePosition>, IComparable<LinePosition> 18/// A <see cref="LinePosition"/> that represents position 0 at line 0. 20public static LinePosition Zero => default(LinePosition); 29/// Initializes a new instance of a <see cref="LinePosition"/> with the given line and character. 86/// Determines whether two <see cref="LinePosition"/> are the same. 88public static bool operator ==(LinePosition left, LinePosition right) 94/// Determines whether two <see cref="LinePosition"/> are different. 96public static bool operator !=(LinePosition left, LinePosition right) 102/// Determines whether two <see cref="LinePosition"/> are the same. 105public bool Equals(LinePosition other) 111/// Determines whether two <see cref="LinePosition"/> are the same. 116return obj is LinePosition && Equals((LinePosition)obj); 120/// Provides a hash function for <see cref="LinePosition"/>. 128/// Provides a string representation for <see cref="LinePosition"/>. 136public int CompareTo(LinePosition other) 142public static bool operator >(LinePosition left, LinePosition right) 147public static bool operator >=(LinePosition left, LinePosition right) 152public static bool operator <(LinePosition left, LinePosition right) 157public static bool operator <=(LinePosition left, LinePosition right)
Text\LinePositionSpan.cs (6)
18private readonly LinePosition _start; 21private readonly LinePosition _end; 29public LinePositionSpan(LinePosition start, LinePosition end) 43public LinePosition Start 51public LinePosition End
Text\TextLineCollection.cs (4)
44/// Gets a <see cref="LinePosition"/> corresponding to a character position. 46public virtual LinePosition GetLinePosition(int position) 61/// Convert a <see cref="LinePosition"/> to a position. 63public int GetPosition(LinePosition position)
Microsoft.CodeAnalysis.CodeStyle (1)
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
71var position = text.Lines.GetLinePosition(index);
Microsoft.CodeAnalysis.CSharp (8)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1320var linePositionZeroBased = referencedToken.GetLocation().GetLineSpan().StartLinePosition;
Syntax\CSharpLineDirectiveMap.cs (6)
99tryGetPosition(spanDirective.Start, isEnd: false, out LinePosition mappedStart) && 100tryGetPosition(spanDirective.End, isEnd: true, out LinePosition mappedEnd) && 161static bool tryGetPosition(LineDirectivePositionSyntax syntax, bool isEnd, out LinePosition position) 182var unmappedPos = sourceText.Lines.GetLinePosition(position); 231var unmappedStartPos = lines.GetLinePosition(span.Start); 232var unmappedEndPos = lines.GetLinePosition(span.End);
Syntax\CSharpSyntaxTree.cs (1)
752private LinePosition GetLinePosition(int position, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Features (4)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (4)
148var caretPosition = GetIndentedLinePosition(newDocument, newDocument.Text, desiredCaretLine.LineNumber, options, cancellationToken); 169static LinePosition GetIndentedLinePosition(ParsedDocument document, SourceText sourceText, int lineNumber, IndentationOptions options, CancellationToken cancellationToken) 174var baseLinePosition = sourceText.Lines.GetLinePosition(indentation.BasePosition); 177var indentedLinePosition = new LinePosition(lineNumber, totalOffset);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
EditAndContinue\Helpers\EditingTestBase.cs (1)
105internal static RuntimeRudeEditDescription RuntimeRudeEdit(int marker, RudeEditKind rudeEditKind, LinePosition position, params string[] arguments)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\LineSpanDirectiveTests.cs (1)
496static int getTextPosition(TextLineCollection lines, LinePosition position)
Parsing\ParserRegressionTests.cs (1)
167var endLinePosition = fileLinePositionSpan.EndLinePosition;
Microsoft.CodeAnalysis.EditorFeatures (2)
CodeDefinitionWindow\CodeDefinitionWindowLocation.cs (1)
9internal record struct CodeDefinitionWindowLocation(string DisplayName, string FilePath, LinePosition Position);
Navigation\IDocumentNavigationServiceExtensions.cs (1)
87var linePosition = new LinePosition(lineNumber, offset);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
180var startPosition = ProtocolConversions.PositionToLinePosition(edit.Range.Start); 181var endPosition = ProtocolConversions.PositionToLinePosition(edit.Range.End);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (4)
Utilities\GoToHelpers\MockSymbolNavigationService.vb (2)
29Public Function GetExternalNavigationSymbolLocationAsync(definitionItem As DefinitionItem, cancellationToken As CancellationToken) As Task(Of (filePath As String, linePosition As LinePosition)?) Implements ISymbolNavigationService.GetExternalNavigationSymbolLocationAsync 31Return Task.FromResult(Of (filePath As String, linePosition As LinePosition)?)(Nothing)
Utilities\MockSymbolNavigationServiceProvider.vb (2)
66cancellationToken As CancellationToken) As Task(Of (filePath As String, LinePosition As LinePosition)?) Implements ISymbolNavigationService.GetExternalNavigationSymbolLocationAsync 69Return Task.FromResult(Of (filePath As String, linePosition As LinePosition)?)((Me.NavigationFilePathReturnValue, New LinePosition(Me.NavigationLineNumberReturnValue, Me.NavigationCharOffsetReturnValue)))
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
167public override LinePosition GetLinePosition(int position)
Microsoft.CodeAnalysis.ExternalAccess.Razor (11)
Cohost\Handlers\Completion.cs (2)
29LinePosition linePosition, 73LinePosition position,
Cohost\Handlers\DocumentHighlights.cs (1)
17public static Task<DocumentHighlight[]?> GetHighlightsAsync(Document document, LinePosition linePosition, CancellationToken cancellationToken)
Cohost\Handlers\FindAllReferences.cs (1)
20public static async Task<SumType<VSInternalReferenceItem, Location>[]?> FindReferencesAsync(Workspace workspace, Document document, LinePosition linePosition, bool supportsVSExtensions, CancellationToken cancellationToken)
Cohost\Handlers\GoToDefinition.cs (1)
18public static Task<Location[]?> GetDefinitionsAsync(Workspace workspace, Document document, bool typeOnly, LinePosition linePosition, CancellationToken cancellationToken)
Cohost\Handlers\GoToImplementation.cs (1)
18public static Task<Location[]> FindImplementationsAsync(Document document, LinePosition linePosition, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Cohost\Handlers\Hover.cs (1)
18LinePosition linePosition,
Cohost\Handlers\OnAutoInsert.cs (1)
20public static Task<VSInternalDocumentOnAutoInsertResponseItem?> GetOnAutoInsertResponseAsync(Document document, LinePosition linePosition, string character, FormattingOptions formattingOptions, CancellationToken cancellationToken)
Cohost\Handlers\Rename.cs (2)
15public static Task<Range?> GetRenameRangeAsync(Document document, LinePosition linePosition, CancellationToken cancellationToken) 18public static Task<WorkspaceEdit?> GetRenameEditAsync(Document document, LinePosition linePosition, string newName, CancellationToken cancellationToken)
Cohost\Handlers\SignatureHelp.cs (1)
16public static Task<LSP.SignatureHelp?> GetSignatureHelpAsync(Document document, LinePosition linePosition, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (11)
BraceCompletion\AbstractBraceCompletionService.cs (1)
64var caretLocation = new LinePosition(originalOpeningLinePosition.Line, originalOpeningLinePosition.Character + 1);
BraceCompletion\IBraceCompletionService.cs (2)
74internal readonly struct BraceCompletionResult(ImmutableArray<TextChange> textChanges, LinePosition caretLocation) 90public LinePosition CaretLocation { get; } = caretLocation;
CodeLens\CodeLensReferencesService.cs (1)
147var startLinePosition = location.GetLineSpan().StartLinePosition;
EditAndContinue\SourceFileSpan.cs (4)
53/// Gets the <see cref="LinePosition"/> of the start of the span. 55public LinePosition Start 59/// Gets the <see cref="LinePosition"/> of the end of the span. 61public LinePosition End
Navigation\DefaultSymbolNavigationService.cs (2)
21public Task<(string filePath, LinePosition linePosition)?> GetExternalNavigationSymbolLocationAsync(DefinitionItem definitionItem, CancellationToken cancellationToken) 22=> Task.FromResult<(string filePath, LinePosition linePosition)?>(null);
Navigation\ISymbolNavigationService.cs (1)
30Task<(string filePath, LinePosition linePosition)?> GetExternalNavigationSymbolLocationAsync(
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
EditAndContinue\RuntimeRudeEditDescription.cs (1)
9internal sealed class RuntimeRudeEditDescription(int markerId, RudeEditKind kind, LinePosition position, string[] arguments)
EditAndContinue\SyntaxMapDescription.cs (2)
20public LinePosition NodePosition(int index) 28public LinePosition Position(int index)
Microsoft.CodeAnalysis.LanguageServer.Protocol (28)
Extensions\Extensions.cs (1)
184public static async Task<int> GetPositionFromLinePositionAsync(this TextDocument document, LinePosition linePosition, CancellationToken cancellationToken)
Extensions\ProtocolConversions.cs (2)
292public static LinePosition PositionToLinePosition(LSP.Position position) 343public static LSP.Position LinePositionToPosition(LinePosition linePosition)
Handler\DataTips\DataTipRangeHandler.cs (1)
36var linePosition = ProtocolConversions.PositionToLinePosition(request.Position);
Handler\Definitions\AbstractGoToDefinitionHandler.cs (2)
45var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 50internal static async Task<LSP.Location[]?> GetDefinitionsAsync(IGlobalOptionService globalOptions, IMetadataAsSourceFileService? metadataAsSourceFileService, Workspace workspace, Document document, bool forSymbolType, LinePosition linePosition, CancellationToken cancellationToken)
Handler\Diagnostics\DiagnosticsPullCache.cs (1)
117static void WriteLinePosition(LinePosition position, ObjectWriter writer)
Handler\Highlights\DocumentHighlightHandler.cs (2)
49var position = ProtocolConversions.PositionToLinePosition(request.Position); 53internal static async Task<DocumentHighlight[]?> GetHighlightsAsync(IGlobalOptionService globalOptions, IHighlightingService highlightingService, Document document, LinePosition linePosition, CancellationToken cancellationToken)
Handler\Hover\HoverHandler.cs (2)
47var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 70LinePosition linePosition,
Handler\InlineCompletions\InlineCompletionsHandler.cs (2)
107var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 118internal static async Task<VSInternalInlineCompletionItem?> GetInlineCompletionItemsAsync(ILspLogger logger, Document document, LinePosition linePosition, LSP.FormattingOptions options, XmlSnippetParser xmlSnippetParser, CancellationToken cancellationToken)
Handler\OnAutoInsert\OnAutoInsertHandler.cs (6)
59var position = ProtocolConversions.PositionToLinePosition(request.Position); 67LinePosition linePosition, 115LinePosition linePosition, 147LinePosition linePosition, 212LinePosition desiredCaretLinePosition, 231static string GetTextChangeTextWithCaretAtLocation(SourceText sourceText, TextChange textChange, LinePosition desiredCaretLinePosition)
Handler\References\FindAllReferencesHandler.cs (2)
59var linePosition = ProtocolConversions.PositionToLinePosition(referenceParams.Position); 73LinePosition linePosition,
Handler\References\FindImplementationsHandler.cs (2)
41var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 47internal static async Task<LSP.Location[]> FindImplementationsAsync(Document document, LinePosition linePosition, OptionsProvider<ClassificationOptions> classificationOptions, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Handler\Rename\PrepareRenameHandler.cs (1)
31internal static async Task<LSP.Range?> GetRenameRangeAsync(Document document, LinePosition linePosition, CancellationToken cancellationToken)
Handler\Rename\RenameHandler.cs (1)
34internal static async Task<WorkspaceEdit?> GetRenameEditAsync(Document document, LinePosition linePosition, string newName, CancellationToken cancellationToken)
Handler\SemanticTokens\SemanticTokensHelpers.cs (1)
295var linePosition = lines.GetLinePositionSpan(originalTextSpan).Start;
Handler\SignatureHelp\SignatureHelpHandler.cs (2)
40var linePosition = ProtocolConversions.PositionToLinePosition(request.Position); 44internal static async Task<LSP.SignatureHelp?> GetSignatureHelpAsync(SignatureHelpService signatureHelpService, Document document, LinePosition linePosition, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Test.Utilities (10)
Diagnostics\DiagnosticDescription.cs (6)
35private readonly LinePosition? _startPosition; // May not have a value only in the case that we're constructed via factories 77LinePosition? startLocation, 102LinePosition? startLocation, 630private class LinePositionComparer : IComparer<LinePosition?> 634public int Compare(LinePosition? x, LinePosition? y)
TestBase.cs (2)
331LinePosition? startLocation = null, 350LinePosition? startLocation = null,
TestHelpers.cs (2)
100LinePosition? startLocation = null, 126LinePosition? startLocation = null,
Microsoft.CodeAnalysis.UnitTests (5)
Diagnostics\SarifErrorLoggerTests.cs (2)
36var position = new LinePositionSpan(LinePosition.Zero, LinePosition.Zero);
LinePositionTests.cs (3)
32() => { var notUsed = new LinePosition(-1, 42); }); 39() => { var notUsed = new LinePosition(42, -1); }); 45var lp = new LinePosition(42, 13);
Microsoft.CodeAnalysis.VisualBasic (2)
Syntax\VisualBasicLineDirectiveMap.vb (1)
148Dim unmappedPos As LinePosition = sourceText.Lines.GetLinePosition(position)
Syntax\VisualBasicSyntaxTree.vb (1)
484Private Function GetLinePosition(position As Integer) As LinePosition
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
EditAndContinue\Helpers\EditingTestBase.vb (1)
144Friend Shared Function RuntimeRudeEdit(marker As Integer, rudeEditKind As RudeEditKind, position As LinePosition, ParamArray arguments As String()) As RuntimeRudeEditDescription
Microsoft.CodeAnalysis.Workspaces (3)
Shared\Extensions\FileLinePositionSpanExtensions.cs (2)
81var start = new LinePosition(startLine, startColumn); 82var end = new LinePosition(endLine, endColumn);
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
71var position = text.Lines.GetLinePosition(index);
Microsoft.VisualStudio.LanguageServices (14)
Diagnostics\VisualStudioVenusSpanMappingService.cs (8)
125private static LinePositionSpan GetLinePositionSpan(LinePosition position1, LinePosition position2) 135public static LinePosition GetAdjustedLineColumn(DocumentId documentId, int originalLine, int originalColumn, int mappedLine, int mappedColumn) 215if (TryFixUpNearestVisibleSpan(bufferCoordinator, nearestVisibleSpanOnSecondaryBuffer.iStartLine, nearestVisibleSpanOnSecondaryBuffer.iStartIndex, out var adjustedPosition)) 227int originalLine, int originalColumn, out LinePosition adjustedPosition) 247adjustedPosition = LinePosition.Zero; 281public LinePosition OriginalLinePosition 286public LinePosition MappedLinePosition
FindReferences\VisualStudioDefinitionsAndReferencesFactory.cs (2)
48string filePath, LinePosition linePosition) 78LinePosition linePosition)
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
265var linePosition = new LinePosition(line, 0);
Workspace\VisualStudioDocumentNavigationService.cs (1)
134var linePosition = new LinePosition(lineNumber, offset);
Workspace\VisualStudioSymbolNavigationService.cs (2)
198public async Task<(string filePath, LinePosition linePosition)?> GetExternalNavigationSymbolLocationAsync( 208public async Task<(string filePath, LinePosition linePosition)?> GetExternalNavigationLocationForSpecificSymbolAsync(
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Venus\DocumentService_IntegrationTests.vb (2)
96Dim actual = New List(Of (String, LinePosition, String)) 157Dim actual = New List(Of (String, LinePosition, String))