feat: add live-cycling LSP completion
This commit is contained in:
@@ -105,6 +105,24 @@ pub struct SemanticToken {
|
||||
pub modifiers: u16,
|
||||
}
|
||||
|
||||
/// A completion replacement in zero-based, end-exclusive grapheme coordinates.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct CompletionEdit {
|
||||
pub start: TextPosition,
|
||||
pub end: TextPosition,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
/// Protocol-independent completion text and its atomic document edits.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct CompletionItem {
|
||||
pub label: String,
|
||||
pub detail: Option<String>,
|
||||
/// Index of the primary replacement; other edits never determine caret placement.
|
||||
pub primary_edit: usize,
|
||||
pub edits: Vec<CompletionEdit>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde(tag = "type", rename_all = "snake_case", deny_unknown_fields)]
|
||||
pub enum UpdateEffect {
|
||||
@@ -132,6 +150,12 @@ pub enum UpdateEffect {
|
||||
revision: u64,
|
||||
text: String,
|
||||
},
|
||||
#[serde(skip_deserializing)]
|
||||
Completion {
|
||||
buffer_id: usize,
|
||||
revision: u64,
|
||||
items: Vec<CompletionItem>,
|
||||
},
|
||||
Message {
|
||||
text: String,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user