Table of Contents

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

Label string

The name, as it is written.

Kind CompletionItemKind

What kind of thing it names, as a client shows it.

Detail string

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.

Documentation string

What the name is, in a sentence or two: the doc string of a library member, chiefly.

Symbol Symbol

The symbol the name binds to; null for a keyword or an intrinsic type name.

Rank int

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.

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

string

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

string

Kind

What kind of thing it names, as a client shows it.

public CompletionItemKind Kind { get; init; }

Property Value

CompletionItemKind

Label

The name, as it is written.

public string Label { get; init; }

Property Value

string

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

int

Symbol

The symbol the name binds to; null for a keyword or an intrinsic type name.

public Symbol? Symbol { get; init; }

Property Value

Symbol

Methods

ToCompletionItem()

The candidate as an item of an LSP completion list (LSP 3.17 §Completion Request).

public CompletionItem ToCompletionItem()

Returns

CompletionItem

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.