109 instantiations of Position
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Extensions\ProtocolConversions.cs (1)
360
=> new LSP.
Position
{ Line = linePosition.Line, Character = linePosition.Character };
Extensions\ProtocolConversions.Diagnostics.cs (2)
148
Start = new
Position
153
End = new
Position
Handler\CodeActions\CodeActionResolveHelper.cs (2)
260
var emptyDocumentRange = new LSP.Range { Start = new
Position
{ Line = 0, Character = 0 }, End = new
Position
{ Line = 0, Character = 0 } };
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (101)
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 } },
236
applicableRange: new LSP.Range { Start = new
Position
{ Line = 2, Character = 33 }, End = new
Position
{ Line = 39, Character = 2 } },
295
applicableRange: new LSP.Range { Start = new
Position
{ Line = 0, Character = 6 }, End = new
Position
{ Line = 0, Character = 9 } },
320
Start = new
Position
()
325
End = new
Position
()
350
Start = new
Position
()
355
End = new
Position
()
377
applicableRange: new LSP.Range { Start = new
Position
{ Line = 0, Character = 6 }, End = new
Position
{ Line = 0, Character = 9 } },
423
applicableRange: new LSP.Range { Start = new
Position
{ Line = 3, Character = 6 }, End = new
Position
{ Line = 3, Character = 9 } },
451
Start = new
Position
()
456
End = new
Position
()
480
Start = new
Position
()
485
End = new
Position
()
507
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;\r\n\r\n", Range = new() { Start =
new
(1, 0), End =
new
(1, 0) } };
242
var expectedAdditionalEdit = new TextEdit() { NewText = "using NS2;\r\n\r\n", 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" };
668
Assert.Equal(new() { Start =
new
(2, 0), End = caret.Range.Start }, results.ItemDefaults.EditRange.Value.First);
730
var expectedAdditionalEdit1 = new TextEdit() { NewText = "using Namespace1;\r\n\r\n", Range = new() { Start =
new
(1, 0), End =
new
(1, 0) } };
738
var expectedAdditionalEdit2 = new TextEdit() { NewText = "using Namespace2;\r\n\r\n", Range = new() { Start =
new
(1, 0), End =
new
(1, 0) } };
1004
var expectedEdit = new TextEdit { Range = new LSP.Range { Start =
new
(0, 5), End =
new
(0, 5) }, NewText = "ComplexItem" };
1061
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)\r\n {\r\n throw new System.NotImplementedException();\r\n }" };
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)
94
var position = new LSP.
Position
{ Line = 5, Character = 18 };
Diagnostics\PullDiagnosticTests.cs (5)
341
Assert.Equal(new
Position
{ Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start);
350
Assert.Equal(new
Position
{ Line = 0, Character = 10 }, results[0].Diagnostics!.Single().Range.Start);
1569
Assert.Equal(new
Position
{ Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start);
1582
Assert.Equal(new
Position
{ Line = 0, Character = 10 }, results2[0].Diagnostics!.Single().Range.Start);
1602
Assert.Equal(new
Position
{ Line = 0, Character = 9 }, results[0].Diagnostics!.Single().Range.Start);
DocumentChanges\DocumentChangesTests.cs (2)
355
Start = new LSP.
Position
(startLine, startCol),
356
End = new LSP.
Position
(endLine, endCol)
Metadata\LspMetadataAsSourceWorkspaceTests.cs (2)
108
Start = new LSP.
Position
{ Line = 4, Character = 40 },
109
End = new LSP.
Position
{ Line = 4, Character = 40 }
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (3)
76
var caret = new LSP.Location { Range = new() { Start =
new
(0, 6), End =
new
(0, 7) }, DocumentUri = looseFileUri };
300
Start =
new
(4, 8)
ProtocolConversionsTests.cs (12)
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) };
254
var range = new Range() { Start = new
Position
(0, 0), End = new
Position
(sourceText.Lines.Count, 0) };
265
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)
172
var startPosition = new LSP.
Position
{ Line = 2, Character = 9 };
173
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)
94
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 (2)
ServerInitializationTests.cs (2)
41
Range = new Roslyn.LanguageServer.Protocol.Range { Start = new
Position
(0, 0), End = new
Position
(0, 0) },
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
143
var position = new
Position
(sourceDefinition.Line, sourceDefinition.Column);
37 references to Position
Microsoft.CodeAnalysis.LanguageServer.Protocol (30)
Extensions\Extensions.cs (2)
289
public static int CompareTo(this
Position
p1,
Position
p2)
Extensions\ProtocolConversions.cs (3)
308
public static LinePosition PositionToLinePosition(LSP.
Position
position)
339
static string PositionToString(LSP.
Position
position)
359
public static LSP.
Position
LinePositionToPosition(LinePosition linePosition)
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\Internal\VSInternalRelatedDocumentParams.cs (1)
27
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 (4)
Definitions\GoToDefinitionTests.cs (1)
94
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)
172
var
startPosition = new LSP.Position { Line = 2, Character = 9 };
173
var
endPosition = new LSP.Position { Line = 2, Character = 10 };
Microsoft.VisualStudio.LanguageServices.Xaml (3)
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
82
private static CompletionItem CreateCompletionItem(XamlCompletionItem xamlCompletion, DocumentId documentId, SourceText text,
Position
position, TextDocumentIdentifier textDocument, Dictionary<XamlCompletionKind, ImmutableArray<VSInternalCommitCharacter>> commitCharactersCach)
Implementation\LanguageServer\Handler\Completion\CompletionResolveData.cs (1)
17
public
Position
Position { get; set; }
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
143
var
position = new Position(sourceDefinition.Line, sourceDefinition.Column);