pub struct CompletionItem {
pub label: String,
pub text: Option<String>,
pub sort_text: Option<String>,
pub detail: Option<String>,
pub type_field: Option<CompletionItemType>,
pub start: Option<i64>,
pub length: Option<i64>,
pub selection_start: Option<i64>,
pub selection_length: Option<i64>,
}Expand description
CompletionItems are the suggestions returned from the completions request.
Specification: CompletionItem
Fields§
§label: StringThe 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_field: Option<CompletionItemType>The item’s type. Typically the client uses this information to render the item in the UI with an icon.
start: Option<i64>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<i64>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<i64>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<i64>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.