292 references to 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 (9)
Diagnostic\XmlLocation.cs (2)
22LinePosition start = new LinePosition(lineNumber, columnNumber); 23LinePosition end = new LinePosition(lineNumber, columnNumber + 1);
Syntax\LineDirectiveMap.cs (6)
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); 228new(document.FilePath, new(3, 10), new(3, 11)), documentId); 276new(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 (7)
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));
SemanticSearch\AbstractSemanticSearchService.cs (1)
284position = new LinePosition(line - 1, column - 1);
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)
137location: 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 (127)
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 (39)
22EqualityUnit.Create(new LinePosition(1, 2)).WithEqualValues(new LinePosition(1, 2)), 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))