Struct lsp_types::CompletionItem [−][src]
Fields
label: StringThe label of this completion item. By default also the text that is inserted when selecting this completion.
kind: Option<CompletionItemKind>The kind of this completion item. Based of the kind an icon is chosen by the editor.
detail: Option<String>A human-readable string with additional information about this item, like type or symbol information.
documentation: Option<Documentation>A human-readable string that represents a doc-comment.
deprecated: Option<bool>Indicates if this item is deprecated.
preselect: Option<bool>Select this item when showing.
sort_text: Option<String>A string that shoud be used when comparing this item
with other items. When falsy the label is used.
filter_text: Option<String>A string that should be used when filtering a set of
completion items. When falsy the label is used.
insert_text: Option<String>A string that should be inserted a document when selecting
this completion. When falsy the label is used.
insert_text_format: Option<InsertTextFormat>The format of the insert text. The format applies to both the insertText property
and the newText property of a provided textEdit.
insert_text_mode: Option<InsertTextMode>How whitespace and indentation is handled during completion item insertion.
If not provided the clients default value depends on the textDocument.completion.insertTextMode client capability.
text_edit: Option<CompletionTextEdit>An edit which is applied to a document when selecting this completion. When an edit is provided the value of insertText is ignored.
Most editors support two different operation when accepting a completion item. One is to insert a
completion text and the other is to replace an existing text with a competion text. Since this can
usually not predetermend by a server it can report both ranges. Clients need to signal support for
InsertReplaceEdits via the textDocument.completion.insertReplaceSupport client capability
property.
Note 1: The text edit's range as well as both ranges from a insert replace edit must be a
[single line] and they must contain the position at which completion has been requested.
Note 2: If an InsertReplaceEdit is returned the edit's insert range must be a prefix of
the edit's replace range, that means it must be contained and starting at the same position.
@since 3.16.0 additional type InsertReplaceEdit
additional_text_edits: Option<Vec<TextEdit>>An optional array of additional text edits that are applied when selecting this completion. Edits must not overlap with the main edit nor with themselves.
command: Option<Command>An optional command that is executed after inserting this completion. Note that additional modifications to the current document should be described with the additionalTextEdits-property.
data: Option<Value>An data entry field that is preserved on a completion item between a completion and a completion resolve request.
Tags for this completion item.
Implementations
impl CompletionItem[src]
pub fn new_simple(label: String, detail: String) -> CompletionItem[src]
Create a CompletionItem with the minimum possible info (label and detail).
Trait Implementations
impl Clone for CompletionItem[src]
fn clone(&self) -> CompletionItem[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for CompletionItem[src]
impl Default for CompletionItem[src]
fn default() -> CompletionItem[src]
impl<'de> Deserialize<'de> for CompletionItem[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl PartialEq<CompletionItem> for CompletionItem[src]
fn eq(&self, other: &CompletionItem) -> bool[src]
fn ne(&self, other: &CompletionItem) -> bool[src]
impl Serialize for CompletionItem[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralPartialEq for CompletionItem[src]
Auto Trait Implementations
impl RefUnwindSafe for CompletionItem[src]
impl Send for CompletionItem[src]
impl Sync for CompletionItem[src]
impl Unpin for CompletionItem[src]
impl UnwindSafe for CompletionItem[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,