helix/helix-view/src/handlers/lsp.rs

42 lines
943 B
Rust
Raw Normal View History

2023-12-01 07:03:26 +08:00
use crate::{DocumentId, ViewId};
2022-03-28 10:05:26 +08:00
2023-12-01 07:03:26 +08:00
pub enum CompletionEvent {
/// Auto completion was triggered by typing a word char
AutoTrigger {
cursor: usize,
doc: DocumentId,
view: ViewId,
},
/// Auto completion was triggered by typing a trigger char
/// specified by the LSP
TriggerChar {
cursor: usize,
doc: DocumentId,
view: ViewId,
},
2023-12-01 07:03:26 +08:00
/// A completion was manually requested (c-x)
ManualTrigger {
cursor: usize,
doc: DocumentId,
view: ViewId,
},
2023-12-01 07:03:26 +08:00
/// Some text was deleted and the cursor is now at `pos`
DeleteText { cursor: usize },
2023-12-01 07:03:26 +08:00
/// Invalidate the current auto completion trigger
Cancel,
}
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum SignatureHelpInvoked {
Automatic,
Manual,
}
pub enum SignatureHelpEvent {
Invoked,
Trigger,
ReTrigger,
Cancel,
RequestComplete { open: bool },
}