pub struct CompletionValue {
pub value: String,
pub label: Option<String>,
pub description: Option<String>,
pub kind: Option<CompletionKind>,
pub priority: Option<f64>,
pub metadata: Option<HashMap<String, Value>>,
pub insert_text: Option<String>,
pub range: Option<CompletionRange>,
pub documentation: Option<CompletionDocumentation>,
}Expand description
Individual completion value
Fields§
§value: StringCompletion value
label: Option<String>Optional label (display name)
description: Option<String>Optional description
kind: Option<CompletionKind>Completion kind (function, variable, class, etc.)
priority: Option<f64>Sort priority (higher = more relevant)
metadata: Option<HashMap<String, Value>>Additional metadata
insert_text: Option<String>Insert text (if different from value)
range: Option<CompletionRange>Range to replace
documentation: Option<CompletionDocumentation>Documentation
Implementations§
Source§impl CompletionValue
impl CompletionValue
Sourcepub fn new(value: impl Into<String>) -> CompletionValue
pub fn new(value: impl Into<String>) -> CompletionValue
Create a simple completion value
Sourcepub fn with_label(
value: impl Into<String>,
label: impl Into<String>,
) -> CompletionValue
pub fn with_label( value: impl Into<String>, label: impl Into<String>, ) -> CompletionValue
Create a completion value with label
Sourcepub fn with_description(
value: impl Into<String>,
description: impl Into<String>,
) -> CompletionValue
pub fn with_description( value: impl Into<String>, description: impl Into<String>, ) -> CompletionValue
Create a completion value with description
Sourcepub fn with_kind(
value: impl Into<String>,
kind: CompletionKind,
) -> CompletionValue
pub fn with_kind( value: impl Into<String>, kind: CompletionKind, ) -> CompletionValue
Create a completion value with kind
Sourcepub fn function(
name: impl Into<String>,
description: impl Into<String>,
) -> CompletionValue
pub fn function( name: impl Into<String>, description: impl Into<String>, ) -> CompletionValue
Create a function completion
Trait Implementations§
Source§impl Clone for CompletionValue
impl Clone for CompletionValue
Source§fn clone(&self) -> CompletionValue
fn clone(&self) -> CompletionValue
Returns a duplicate of the value. Read more
1.0.0 · 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 CompletionValue
impl Debug for CompletionValue
Source§impl Default for CompletionValue
impl Default for CompletionValue
Source§fn default() -> CompletionValue
fn default() -> CompletionValue
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CompletionValue
impl<'de> Deserialize<'de> for CompletionValue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompletionValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CompletionValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CompletionValue
impl Serialize for CompletionValue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for CompletionValue
impl RefUnwindSafe for CompletionValue
impl Send for CompletionValue
impl Sync for CompletionValue
impl Unpin for CompletionValue
impl UnwindSafe for CompletionValue
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