112 instantiations of Position
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Extensions\ProtocolConversions.cs (1)
374
=>
new
() { Line = linePosition.Line, Character = linePosition.Character };
Extensions\ProtocolConversions.Diagnostics.cs (2)
161
Start = new
Position
166
End = new
Position
Handler\CodeActions\CodeActionResolveHelper.cs (2)
258
var emptyDocumentRange = new LSP.Range { Start = new
Position
{ Line = 0, Character = 0 }, End = new
Position
{ Line = 0, Character = 0 } };
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (104)
CodeActions\CodeActionResolveTests.cs (36)
48
applicableRange: new LSP.Range { Start = new
Position
{ Line = 4, Character = 8 }, End = new
Position
{ Line = 4, Character = 11 } },
61
GenerateTextEdit("var", new LSP.Range { Start = new
Position
(4, 8), End = new
Position
(4, 11) })
72
applicableRange: new LSP.Range { Start = new
Position
{ Line = 4, Character = 8 }, End = new
Position
{ Line = 4, Character = 11 } },
103
applicableRange: new LSP.Range { Start = new
Position
{ Line = 4, Character = 8 }, End = new
Position
{ Line = 4, Character = 11 } },
122
""", new LSP.Range { Start = new
Position
(2, 4), End = new
Position
(2, 4) }),
123
GenerateTextEdit("V", new LSP.Range { Start = new
Position
(4, 16), End = new
Position
(4, 17) })
135
applicableRange: new LSP.Range { Start = new
Position
{ Line = 4, Character = 8 }, End = new
Position
{ Line = 4, Character = 11 } },
178
applicableRange: new LSP.Range { Start = new
Position
{ Line = 0, Character = 6 }, End = new
Position
{ Line = 0, Character = 9 } },
199
applicableRange: new LSP.Range { Start = new
Position
{ Line = 0, Character = 6 }, End = new
Position
{ Line = 0, Character = 9 } },
237
applicableRange: new LSP.Range { Start = new
Position
{ Line = 2, Character = 33 }, End = new
Position
{ Line = 39, Character = 2 } },
296
applicableRange: new LSP.Range { Start = new
Position
{ Line = 0, Character = 6 }, End = new
Position
{ Line = 0, Character = 9 } },
321
Start = new
Position
()
326
End = new
Position
()
351
Start = new
Position
()
356
End = new
Position
()
378
applicableRange: new LSP.Range { Start = new
Position
{ Line = 0, Character = 6 }, End = new
Position
{ Line = 0, Character = 9 } },
424
applicableRange: new LSP.Range { Start = new
Position
{ Line = 3, Character = 6 }, End = new
Position
{ Line = 3, Character = 9 } },
452
Start = new
Position
()
457
End = new
Position
()
481
Start = new
Position
()
486
End = new
Position
()
508
applicableRange: new LSP.Range { Start = new
Position
{ Line = 3, Character = 6 }, End = new
Position
{ Line = 3, Character = 9 } },
CodeActions\CodeActionsTests.cs (4)
51
applicableRange: new LSP.Range { Start = new
Position
{ Line = 4, Character = 8 }, End = new
Position
{ Line = 4, Character = 11 } },
87
applicableRange: new LSP.Range { Start = new
Position
{ Line = 4, Character = 12 }, End = new
Position
{ Line = 4, Character = 12 } },
Completion\CompletionFeaturesTests.cs (17)
156
? new() { NewText = "System.Threading.Tasks.Task", Range = new() { Start =
new
(0, 20), End =
new
(0, 24) } }
157
: new() { NewText = $"using System.Threading.Tasks;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start =
new
(1, 0), End =
new
(1, 0) } };
242
var expectedAdditionalEdit = new TextEdit() { NewText = $"using NS2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start =
new
(1, 0), End =
new
(1, 0) } };
301
var expectedEdit = new TextEdit { Range = new LSP.Range { Start =
new
(1, 5), End =
new
(1, 9) }, NewText = "summary" };
669
Assert.Equal(new() { Start =
new
(2, 0), End = caret.Range.Start }, results.ItemDefaults.EditRange.Value.First);
731
var expectedAdditionalEdit1 = new TextEdit() { NewText = $"using Namespace1;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start =
new
(1, 0), End =
new
(1, 0) } };
739
var expectedAdditionalEdit2 = new TextEdit() { NewText = $"using Namespace2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start =
new
(1, 0), End =
new
(1, 0) } };
1005
var expectedEdit = new TextEdit { Range = new LSP.Range { Start =
new
(0, 5), End =
new
(0, 5) }, NewText = "ComplexItem" };
1062
var expectedEdit = new TextEdit { Range = new LSP.Range { Start =
new
(7, 4), End =
new
(7, 13) }, NewText = $"public override global::System.Boolean AbstractMethod(global::System.Int32 x){Environment.NewLine} {{{Environment.NewLine} throw new System.NotImplementedException();{Environment.NewLine} }}" };
Completion\CompletionTests.cs (8)
498
Start = new LSP.
Position
{ Line = 5, Character = 19 },
499
End = new LSP.
Position
{ Line = 5, Character = 19 }
537
Start = new LSP.
Position
{ Line = 5, Character = 21 },
538
End = new LSP.
Position
{ Line = 5, Character = 21 }
576
Start = new LSP.
Position
{ Line = 5, Character = 25 },
577
End = new LSP.
Position
{ Line = 5, Character = 25 }
1538
Assert.Equal(new() { Start =
new
(2, 0), End =
new
(2, 8) }, results.ItemDefaults.EditRange.Value.First);
DataTips\DataTipRangeHandlerTests.cs (4)
51
Start = new LSP.
Position
{ Line = 3, Character = 8 },
52
End = new LSP.
Position
{ Line = 3, Character = 19 },
56
Start = new LSP.
Position
{ Line = 3, Character = 8 },
57
End = new LSP.
Position
{ Line = 3, Character = 38 },
Definitions\GoToDefinitionTests.cs (1)
101
var position = new LSP.
Position
{ Line = 5, Character = 18 };
Diagnostics\PullDiagnosticTests.cs (7)
354
Assert.Equal(new
Position
{ Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start);
363
Assert.Equal(new
Position
{ Line = 0, Character = 10 }, results[0].Diagnostics!.Single().Range.Start);
831
Start = new LSP.
Position
(originalSpan.Start.Line, originalSpan.Start.Character),
832
End = new LSP.
Position
(originalSpan.End.Line, originalSpan.End.Character)
1711
Assert.Equal(new
Position
{ Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start);
1724
Assert.Equal(new
Position
{ Line = 0, Character = 10 }, results2[0].Diagnostics!.Single().Range.Start);
1744
Assert.Equal(new
Position
{ Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start);
DocumentChanges\DocumentChangesTests.cs (2)
372
Start = new LSP.
Position
(startLine, startCol),
373
End = new LSP.
Position
(endLine, endCol)
Metadata\LspMetadataAsSourceWorkspaceTests.cs (2)
107
Start = new LSP.
Position
{ Line = 4, Character = 40 },
108
End = new LSP.
Position
{ Line = 4, Character = 40 }
ProtocolConversionsTests.cs (16)
191
var range = new Range() { Start = new
Position
(0, 0), End = new
Position
(1, 0) };
206
var range = new Range() { Start = new
Position
(2, 8), End = new
Position
(2, 12) };
219
var range = new Range() { Start = new
Position
(0, 0), End = new
Position
(3, 1) };
240
var range = new Range() { Start = new
Position
(0, 0), End = new
Position
(4, 0) };
260
Start = new
Position
(lastLineIndex, 0),
261
End = new
Position
(lastLineIndex + 1, 0)
279
var range = new Range() { Start = new
Position
(0, 0), End = new
Position
(sourceText.Lines.Count + 1, 0) };
289
var range = new Range() { Start = new
Position
(0, 0), End = new
Position
(sourceText.Lines.Count, 5) };
300
var range = new Range() { Start = new
Position
(2, 20), End = new
Position
(3, 0) };
References\FindImplementationsTests.cs (1)
96
var position = new LSP.
Position
{ Line = 2, Character = 9 };
Rename\RenameTests.cs (2)
173
var startPosition = new LSP.
Position
{ Line = 2, Character = 9 };
174
var endPosition = new LSP.
Position
{ Line = 2, Character = 10 };
SemanticTokens\SemanticTokensRangesTests.cs (2)
31
var ranges = new[] { new LSP.Range { Start = new
Position
(0, 0), End = new
Position
(2, 0) } };
Workspaces\SourceGeneratedDocumentTests.cs (2)
120
var location = new LSP.Location { DocumentUri = sourceGeneratorDocumentUri, Range = new LSP.Range { Start = new LSP.
Position
(0, 6), End = new LSP.
Position
(0, 6) } };
Microsoft.CodeAnalysis.LanguageServer.UnitTests (3)
FileBasedProgramsWorkspaceTests.cs (1)
870
new HoverParams() { Position = new
Position
(0, 0), TextDocument = new TextDocumentIdentifier { DocumentUri = nonFileUri } },
ServerInitializationTests.cs (2)
41
Range = new Roslyn.LanguageServer.Protocol.Range { Start = new
Position
(0, 0), End = new
Position
(0, 0) },
36 references to Position
Microsoft.CodeAnalysis.LanguageServer.Protocol (30)
Extensions\Extensions.cs (2)
303
public static int CompareTo(this
Position
p1,
Position
p2)
Extensions\ProtocolConversions.cs (3)
308
public static LinePosition PositionToLinePosition(LSP.
Position
position)
353
static string PositionToString(LSP.
Position
position)
373
public static LSP.
Position
LinePositionToPosition(LinePosition linePosition)
Handler\SelectionRanges\SelectionRangeHandler.cs (1)
38
foreach (
var
position in request.Positions)
Protocol\DocumentOnTypeFormattingParams.cs (1)
32
public
Position
Position { get; set; }
Protocol\InlayHint.cs (1)
27
public
Position
Position
Protocol\Internal\VSInternalDocumentOnAutoInsertParams.cs (1)
28
public
Position
Position
Protocol\Internal\VSInternalInlineCompletionRequest.cs (1)
29
public
Position
Position { get; set; }
Protocol\ITextDocumentPositionParams.cs (1)
23
public
Position
Position { get; set; }
Protocol\ParameterInformation.cs (1)
25
/// The offsets are based on a UTF-16 string representation, like <see cref="
Position
"/> and
Protocol\Position.cs (9)
15
internal sealed class Position : IEquatable<
Position
>
18
/// Initializes a new instance of the <see cref="
Position
"/> class.
25
/// Initializes a new instance of the <see cref="
Position
"/> class.
61
public static bool operator ==(
Position
? firstPosition,
Position
? secondPosition)
87
public static bool operator !=(
Position
? firstPosition,
Position
? secondPosition)
99
return this.Equals(obj as
Position
);
103
public bool Equals(
Position
? other)
Protocol\PrepareRenameParams.cs (1)
29
public
Position
Position { get; set; }
Protocol\Range.cs (6)
23
public
Position
Start
34
public
Position
End
71
EqualityComparer<
Position
>.Default.Equals(this.Start, other.Start) &&
72
EqualityComparer<
Position
>.Default.Equals(this.End, other.End);
79
hashCode = (hashCode * -1521134295) + EqualityComparer<
Position
>.Default.GetHashCode(this.Start);
80
hashCode = (hashCode * -1521134295) + EqualityComparer<
Position
>.Default.GetHashCode(this.End);
Protocol\SelectionRangeParams.cs (1)
31
public
Position
[] Positions { get; init; }
Protocol\TextDocumentPositionParams.cs (1)
30
public
Position
Position
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Definitions\GoToDefinitionTests.cs (1)
101
var
position = new LSP.Position { Line = 5, Character = 18 };
References\FindImplementationsTests.cs (1)
96
var
position = new LSP.Position { Line = 2, Character = 9 };
Rename\RenameTests.cs (2)
173
var
startPosition = new LSP.Position { Line = 2, Character = 9 };
174
var
endPosition = new LSP.Position { Line = 2, Character = 10 };
Symbols\DocumentSymbolsTests.Hierarchical.cs (2)
825
private static bool IsPositionBeforeOrEqual(LSP.
Position
a, LSP.
Position
b)