pub struct CompletionItem {
pub label: String,
pub text: Option<String>,
pub sort_text: Option<String>,
pub detail: Option<String>,
pub type_: Option<CompletionItemType>,
pub start: Option<u64>,
pub length: Option<u64>,
pub selection_start: Option<u64>,
pub selection_length: Option<u64>,
}
Expand description
CompletionItems
are the suggestions returned from the completions
request.
Fields§
§label: String
The label of this completion item. By default this is also the text that is inserted when selecting this completion.
text: Option<String>
If text is returned and not an empty string, then it is inserted instead of the label.
sort_text: Option<String>
A string that should be used when comparing this item with other items. If not returned or an empty string, the label
is used instead.
detail: Option<String>
A human-readable string with additional information about this item, like type or symbol information.
type_: Option<CompletionItemType>
The item’s type. Typically the client uses this information to render the item in the UI with an icon.
start: Option<u64>
Start position (within the text
attribute of the completions
request) where the completion text is added. The position is measured in UTF-16 code units and the client capability columnsStartAt1
determines whether it is 0- or 1-based. If the start position is omitted the text is added at the location specified by the column
attribute of the completions
request.
length: Option<u64>
Length determines how many characters are overwritten by the completion text and it is measured in UTF-16 code units. If missing the value 0 is assumed which results in the completion text being inserted.
selection_start: Option<u64>
Determines the start of the new selection after the text has been inserted (or replaced). selectionStart
is measured in UTF-16 code units and must be in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text.
selection_length: Option<u64>
Determines the length of the new selection after the text has been inserted (or replaced) and it is measured in UTF-16 code units. The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0.
Trait Implementations§
Source§impl Clone for CompletionItem
impl Clone for CompletionItem
Source§fn clone(&self) -> CompletionItem
fn clone(&self) -> CompletionItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more