pub struct CompletionItem {
    pub label: String,
    pub length: Option<i64>,
    pub selection_length: Option<i64>,
    pub selection_start: Option<i64>,
    pub sort_text: Option<String>,
    pub start: Option<i64>,
    pub text: Option<String>,
    pub type_: Option<CompletionItemType>,
}
Expand description

CompletionItems are the suggestions returned from the CompletionsRequest.

Fields

label: String

The label of this completion item. By default this is also the text that is inserted when selecting this completion.

length: Option<i64>

This value determines how many characters are overwritten by the completion text. If missing the value 0 is assumed which results in the completion text being inserted.

selection_length: Option<i64>

Determines the length of the new selection after the text has been inserted (or replaced). The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0.

selection_start: Option<i64>

Determines the start of the new selection after the text has been inserted (or replaced). The start position must in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text.

sort_text: Option<String>

A string that should be used when comparing this item with other items. When falsy the label is used.

start: Option<i64>

This value determines the location (in the CompletionsRequest’s ‘text’ attribute) where the completion text is added. If missing the text is added at the location specified by the CompletionsRequest’s ‘column’ attribute.

text: Option<String>

If text is not falsy then it is inserted instead of the label.

type_: Option<CompletionItemType>

The item’s type. Typically the client uses this information to render the item in the UI with an icon.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more