Class CompletionCandidate
- Namespace
- RDCore.SDK.Model.Symbols.Completion
- Assembly
- RDCore.SDK.dll
One item of a completion list: a name that can be written where the list was asked for, and what it names.
public sealed record CompletionCandidate : IEquatable<CompletionCandidate>
- Inheritance
-
CompletionCandidate
- Implements
- Inherited Members
Constructors
CompletionCandidate(string, CompletionItemKind, string?, string?, Symbol?, int)
One item of a completion list: a name that can be written where the list was asked for, and what it names.
public CompletionCandidate(string Label, CompletionItemKind Kind, string? Detail = null, string? Documentation = null, Symbol? Symbol = null, int Rank = 0)
Parameters
LabelstringThe name, as it is written.
KindCompletionItemKindWhat kind of thing it names, as a client shows it.
DetailstringWhat a client shows next to the name: the type of a variable, the signature of a procedure; null when there is nothing to say.
DocumentationstringWhat the name is, in a sentence or two: the doc string of a library member, chiefly.
SymbolSymbolThe symbol the name binds to; null for a keyword or an intrinsic type name.
RankintWhere the candidate ranks among the others, ahead of the alphabetical order of their names: what is declared nearer to where the list was asked for comes first, and the keywords last.
Properties
Detail
What a client shows next to the name: the type of a variable, the signature of a procedure; null when there is nothing to say.
public string? Detail { get; init; }
Property Value
Documentation
What the name is, in a sentence or two: the doc string of a library member, chiefly.
public string? Documentation { get; init; }
Property Value
Kind
What kind of thing it names, as a client shows it.
public CompletionItemKind Kind { get; init; }
Property Value
Label
The name, as it is written.
public string Label { get; init; }
Property Value
Rank
Where the candidate ranks among the others, ahead of the alphabetical order of their names: what is declared nearer to where the list was asked for comes first, and the keywords last.
public int Rank { get; init; }
Property Value
Symbol
The symbol the name binds to; null for a keyword or an intrinsic type name.
public Symbol? Symbol { get; init; }
Property Value
Methods
ToCompletionItem()
The candidate as an item of an LSP completion list (LSP 3.17 §Completion Request).
public CompletionItem ToCompletionItem()
Returns
Remarks
What is inserted and what is filtered by is the label, which is what a client takes when an item has no insertText and no filterText: they
are not written, since a list can have a thousand items, and each travels.