pub struct CompletionItem {
pub insert_text: String,
pub range_start: Option<i64>,
pub range_end: Option<i64>,
pub attachment: MessageAttachment,
}Expand description
A single completion item returned by the completions command.
When the user accepts an item, the client SHOULD:
- Replace the range
[rangeStart, rangeEnd)in the input withinsertText(or insertinsertTextat the cursor when the range is omitted). - Associate the item’s
attachmentwith the resulting {@link Message}.
Fields§
§insert_text: StringThe text inserted into the input when this item is accepted.
range_start: Option<i64>If defined, the start of the range in the input’s text that is replaced
by insertText. The range is the half-open interval
[rangeStart, rangeEnd) of character offsets, measured in UTF-16 code
units.
When omitted, the client SHOULD insert insertText at the cursor.
Note: this range refers to positions in the current input. The
attachment’s own rangeStart/rangeEnd (when present) refer to
positions in the final {@link Message.text} after the item is
accepted.
range_end: Option<i64>The end of the range in the input’s text that is replaced by
insertText. See {@link rangeStart}.
attachment: MessageAttachmentThe attachment associated with this completion item.
Trait Implementations§
Source§impl Clone for CompletionItem
impl Clone for CompletionItem
Source§fn clone(&self) -> CompletionItem
fn clone(&self) -> CompletionItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompletionItem
impl Debug for CompletionItem
Source§impl<'de> Deserialize<'de> for CompletionItem
impl<'de> Deserialize<'de> for CompletionItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CompletionItem
impl PartialEq for CompletionItem
Source§fn eq(&self, other: &CompletionItem) -> bool
fn eq(&self, other: &CompletionItem) -> bool
self and other values to be equal, and is used by ==.