pub struct CompletionItem {
pub insert_text: String,
pub label: String,
pub completion_type: CompletionType,
pub description: Option<String>,
pub detail: Option<String>,
pub sort_order: u32,
}Expand description
A single completion suggestion
Fields§
§insert_text: StringText to insert
label: StringDisplay label
completion_type: CompletionTypeType of completion
description: Option<String>Description of the item
detail: Option<String>Additional details
sort_order: u32Sort priority (lower = higher priority)
Implementations§
Source§impl CompletionItem
impl CompletionItem
Sourcepub fn new(
insert_text: String,
label: String,
completion_type: CompletionType,
) -> Self
pub fn new( insert_text: String, label: String, completion_type: CompletionType, ) -> Self
Create a new completion item
Sourcepub fn with_description(self, description: String) -> Self
pub fn with_description(self, description: String) -> Self
Set description
Sourcepub fn with_detail(self, detail: String) -> Self
pub fn with_detail(self, detail: String) -> Self
Set detail
Sourcepub fn with_sort_order(self, order: u32) -> Self
pub fn with_sort_order(self, order: u32) -> Self
Set sort order
Trait Implementations§
Source§impl Clone for CompletionItem
impl Clone for CompletionItem
Source§fn clone(&self) -> CompletionItem
fn clone(&self) -> CompletionItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletionItem
impl Debug for CompletionItem
impl Eq for CompletionItem
Source§impl PartialEq for CompletionItem
impl PartialEq for CompletionItem
Source§fn eq(&self, other: &CompletionItem) -> bool
fn eq(&self, other: &CompletionItem) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CompletionItem
Auto Trait Implementations§
impl Freeze for CompletionItem
impl RefUnwindSafe for CompletionItem
impl Send for CompletionItem
impl Sync for CompletionItem
impl Unpin for CompletionItem
impl UnsafeUnpin for CompletionItem
impl UnwindSafe for CompletionItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more