61 writes to Line
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Extensions\ProtocolConversions.cs (1)
385=> new() { Line = linePosition.Line, Character = linePosition.Character };
Extensions\ProtocolConversions.Diagnostics.cs (2)
164Line = dataLocation.UnmappedFileSpan.StartLinePosition.Line, 169Line = dataLocation.UnmappedFileSpan.EndLinePosition.Line,
Handler\CodeActions\CodeActionResolveHelper.cs (2)
258var emptyDocumentRange = new LSP.Range { Start = new Position { Line = 0, Character = 0 }, End = new Position { Line = 0, Character = 0 } };
Protocol\Position.cs (1)
31this.Line = line;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (55)
CodeActions\CodeActionResolveTests.cs (30)
48applicableRange: new LSP.Range { Start = new Position { Line = 4, Character = 8 }, End = new Position { Line = 4, Character = 11 } }, 72applicableRange: new LSP.Range { Start = new Position { Line = 4, Character = 8 }, End = new Position { Line = 4, Character = 11 } }, 103applicableRange: new LSP.Range { Start = new Position { Line = 4, Character = 8 }, End = new Position { Line = 4, Character = 11 } }, 135applicableRange: new LSP.Range { Start = new Position { Line = 4, Character = 8 }, End = new Position { Line = 4, Character = 11 } }, 178applicableRange: new LSP.Range { Start = new Position { Line = 0, Character = 6 }, End = new Position { Line = 0, Character = 9 } }, 199applicableRange: new LSP.Range { Start = new Position { Line = 0, Character = 6 }, End = new Position { Line = 0, Character = 9 } }, 237applicableRange: new LSP.Range { Start = new Position { Line = 2, Character = 33 }, End = new Position { Line = 39, Character = 2 } }, 296applicableRange: new LSP.Range { Start = new Position { Line = 0, Character = 6 }, End = new Position { Line = 0, Character = 9 } }, 323Line = 0, 328Line = 0, 353Line = 0, 358Line = 4, 378applicableRange: new LSP.Range { Start = new Position { Line = 0, Character = 6 }, End = new Position { Line = 0, Character = 9 } }, 424applicableRange: new LSP.Range { Start = new Position { Line = 3, Character = 6 }, End = new Position { Line = 3, Character = 9 } }, 454Line = 0, 459Line = 0, 483Line = 3, 488Line = 5, 508applicableRange: new LSP.Range { Start = new Position { Line = 3, Character = 6 }, End = new Position { Line = 3, Character = 9 } },
CodeActions\CodeActionsTests.cs (4)
51applicableRange: new LSP.Range { Start = new Position { Line = 4, Character = 8 }, End = new Position { Line = 4, Character = 11 } }, 87applicableRange: new LSP.Range { Start = new Position { Line = 4, Character = 12 }, End = new Position { Line = 4, Character = 12 } },
Completion\CompletionTests.cs (6)
558Start = new LSP.Position { Line = 5, Character = 19 }, 559End = new LSP.Position { Line = 5, Character = 19 } 597Start = new LSP.Position { Line = 5, Character = 21 }, 598End = new LSP.Position { Line = 5, Character = 21 } 636Start = new LSP.Position { Line = 5, Character = 25 }, 637End = new LSP.Position { Line = 5, Character = 25 }
DataTips\DataTipRangeHandlerTests.cs (4)
51Start = new LSP.Position { Line = 3, Character = 8 }, 52End = new LSP.Position { Line = 3, Character = 19 }, 56Start = new LSP.Position { Line = 3, Character = 8 }, 57End = new LSP.Position { Line = 3, Character = 38 },
Definitions\GoToDefinitionTests.cs (1)
101var position = new LSP.Position { Line = 5, Character = 18 };
Diagnostics\PullDiagnosticTests.cs (5)
354Assert.Equal(new Position { Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start); 363Assert.Equal(new Position { Line = 0, Character = 10 }, results[0].Diagnostics!.Single().Range.Start); 1711Assert.Equal(new Position { Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start); 1724Assert.Equal(new Position { Line = 0, Character = 10 }, results2[0].Diagnostics!.Single().Range.Start); 1744Assert.Equal(new Position { Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start);
Metadata\LspMetadataAsSourceWorkspaceTests.cs (2)
107Start = new LSP.Position { Line = 4, Character = 40 }, 108End = new LSP.Position { Line = 4, Character = 40 }
References\FindImplementationsTests.cs (1)
96var position = new LSP.Position { Line = 2, Character = 9 };
Rename\RenameTests.cs (2)
173var startPosition = new LSP.Position { Line = 2, Character = 9 }; 174var endPosition = new LSP.Position { Line = 2, Character = 10 };
107 references to Line
IdeBenchmarks (1)
Lsp\LspSourceGeneratorBenchmarks.cs (1)
99var typingLine = typingLocation.Range.Start.Line;
Microsoft.CodeAnalysis.LanguageServer (1)
LanguageServer\Handler\CopilotCompletion\CopilotCompletionResolveContextHandler.cs (1)
34var linePosition = new LinePosition(param.DocumentContext.Position.Line, param.DocumentContext.Position.Character);
Microsoft.CodeAnalysis.LanguageServer.Protocol (13)
Extensions\Extensions.cs (4)
305if (p1.Line > p2.Line) 307else if (p1.Line < p2.Line)
Extensions\ProtocolConversions.cs (2)
320=> new(position.Line, position.Character); 365=> $"{{ Line={position.Line}, Character={position.Character} }}";
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (4)
112var breakpointLineDelta = breakpointRange.End.Line - breakpointRange.Start.Line; 113var existingLineDelta = existingRange.End.Line - existingRange.Start.Line;
Protocol\Position.cs (3)
106this.Line == other.Line && 116return this.Line ^ this.Character;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (25)
Completion\CompletionFeaturesTests.cs (4)
359await testLspServer.InsertTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, "s")); 814await testLspServer.InsertTextAsync(caret.DocumentUri, (caret.Range.End.Line, caret.Range.End.Character, "i")); 868await testLspServer.InsertTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, "s")); 1111await testLspServer.InsertTextAsync(caret.DocumentUri, (caret.Range.End.Line, caret.Range.End.Character, "f"));
Completion\CompletionTests.cs (9)
1052await testLspServer.InsertTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, "a")); 1120await testLspServer.InsertTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, "C")); 1189await testLspServer.InsertTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, "ask")); 1201await testLspServer.DeleteTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, caretLocation.Range.End.Line, caretLocation.Range.End.Character + 3)); 1214await testLspServer.InsertTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, "i")); 1415await testLspServer.InsertTextAsync(secondCaretLocation.DocumentUri, (secondCaretLocation.Range.End.Line, secondCaretLocation.Range.End.Character, "S")); 1430await testLspServer.InsertTextAsync(firstCaretLocation.DocumentUri, (firstCaretLocation.Range.End.Line, firstCaretLocation.Range.End.Character, "a")); 1532await testLspServer.InsertTextAsync(caretLocation.DocumentUri, (caretLocation.Range.End.Line, caretLocation.Range.End.Character, "z"));
Diagnostics\PullDiagnosticTests.cs (2)
384Assert.Equal(1, results.Single().Diagnostics!.Single().Range.Start.Line); 1767Assert.Equal(1, results[0].Diagnostics!.Single().Range.Start.Line);
FoldingRanges\FoldingRangesTests.cs (2)
183StartLine = range.Start.Line, 184EndLine = range.End.Line,
SelectionRanges\SelectionRangesTests.cs (4)
248var outerStart = (outer.Start.Line, outer.Start.Character); 249var outerEnd = (outer.End.Line, outer.End.Character); 250var innerStart = (inner.Start.Line, inner.Start.Character); 251var innerEnd = (inner.End.Line, inner.End.Character);
Symbols\DocumentSymbolsTests.Hierarchical.cs (4)
827return a.Line < b.Line || (a.Line == b.Line && a.Character <= b.Character);
Microsoft.CodeAnalysis.Razor.Workspaces (47)
AutoInsert\AutoClosingTagOnAutoInsertProvider.cs (1)
80var edit = LspFactory.CreateTextEdit(position.Line, position.Character - 1, insertionText);
CodeActions\CSharp\TypeAccessibilityCodeActionProvider.cs (2)
89if (end.Line > context.SourceText.Lines.Count || 90end.Character > context.SourceText.Lines[end.Line].End)
Completion\Delegation\DelegatedCompletionHelper.cs (1)
197previousPosition.Line,
Completion\Delegation\TextEditResponseRewriter.cs (1)
90return LspFactory.CreatePosition(hostDocumentPosition.Line, translatedCharacter);
Extensions\LspExtensions_Position.cs (5)
11=> (line, character) = (position.Line, position.Character); 14=> new(position.Line, position.Character); 21var result = position.Line.CompareTo(other.Line); 26=> $"({position.Line}, {position.Character})";
Extensions\LspExtensions_Range.cs (22)
25=> (startLine, startCharacter, endLine, endCharacter) = (range.Start.Line, range.Start.Character, range.End.Line, range.End.Character); 46range.End.Line < other.Start.Line || (range.End.Line == other.Start.Line && range.End.Character < other.Start.Character); 49other.End.Line < range.Start.Line || (other.End.Line == range.Start.Line && other.End.Character < range.Start.Character); 58var overlapStart = range.Start.Line; 59if (range.Start.Line.CompareTo(other.Start.Line) < 0) 61overlapStart = other.Start.Line; 64var overlapEnd = range.End.Line; 65if (range.End.Line.CompareTo(other.End.Line) > 0) 67overlapEnd = other.End.Line; 80return range.Start.Line != range.End.Line; 85return range.Start.Line == range.End.Line;
Extensions\LspExtensions_SourceText.cs (6)
31=> text.IsValidPosition(position.Line, position.Character); 34=> text.TryGetAbsoluteIndex(position.Line, position.Character, out absoluteIndex); 37=> text.GetRequiredAbsoluteIndex(position.Line, position.Character); 40=> text.GetTextSpan(range.Start.Line, range.Start.Character, range.End.Line, range.End.Character); 43=> text.TryGetSourceLocation(position.Line, position.Character, out location);
Extensions\LspFactory.cs (7)
40defaultPosition.Line == 0 && 60defaultRange.Start.Line == 0 && 62defaultRange.End.Line == 0 && 78undefinedPosition.Line == -1 && 94undefinedRange.Start.Line == -1 && 96undefinedRange.End.Line == -1 && 156=> CreateRange(start, CreatePosition(start.Line, start.Character + length));
Formatting\FormattingUtilities.cs (2)
104if (range.Start.Line == range.End.Line)
Microsoft.CodeAnalysis.Remote.Razor (2)
Diagnostics\RemoteDiagnosticsService.cs (1)
82var absoluteIndex = sourceText.GetRequiredAbsoluteIndex(diagnostic.Range.Start.Line, diagnostic.Range.Start.Character);
SignatureHelp\RemoteSignatureHelpService.cs (1)
35var linePosition = new LinePosition(position.Line, position.Character);
Microsoft.VisualStudio.LanguageServices (2)
DocumentOutline\DocumentOutlineViewModel_Utilities.cs (2)
93var originalStartPosition = textSnapshot.GetLineFromLineNumber(symbolRange.Start.Line).Start.Position + symbolRange.Start.Character; 94var originalEndPosition = textSnapshot.GetLineFromLineNumber(symbolRange.End.Line).Start.Position + symbolRange.End.Character;
Microsoft.VisualStudio.LanguageServices.Razor (2)
RazorLanguageService_IVsLanguageDebugInfo.cs (2)
157iStartLine = breakpointRange.Start.Line, 159iEndLine = breakpointRange.End.Line,
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (7)
Cohost\CohostDocumentPullDiagnosticsTest.cs (2)
47Assert.Equal(0, diagnostic.Range.Start.Line); 48Assert.Equal(0, diagnostic.Range.End.Line);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostFindAllReferencesEndpointTest.cs (2)
285matchedText = inputText.Lines[location.Range.Start.Line].ToString(); 292matchedText = text.Lines[location.Range.Start.Line].ToString();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostGoToDefinitionEndpointTest.cs (2)
87var line = File.ReadLines(location.DocumentUri.GetRequiredParsedUri().LocalPath).ElementAt(location.Range.Start.Line); 980var line = File.ReadLines(location.DocumentUri.GetRequiredParsedUri().LocalPath).ElementAt(location.Range.Start.Line);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
264.OrderByDescending(e => e.Range.Start.Line)
Microsoft.VisualStudioCode.RazorExtension.UnitTests (7)
Endpoints\CohostDocumentPullDiagnosticsTest.cs (2)
46Assert.Equal(0, diagnostic.Range.Start.Line); 47Assert.Equal(0, diagnostic.Range.End.Line);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostFindAllReferencesEndpointTest.cs (2)
285matchedText = inputText.Lines[location.Range.Start.Line].ToString(); 292matchedText = text.Lines[location.Range.Start.Line].ToString();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostGoToDefinitionEndpointTest.cs (2)
87var line = File.ReadLines(location.DocumentUri.GetRequiredParsedUri().LocalPath).ElementAt(location.Range.Start.Line); 980var line = File.ReadLines(location.DocumentUri.GetRequiredParsedUri().LocalPath).ElementAt(location.Range.Start.Line);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
264.OrderByDescending(e => e.Range.Start.Line)