Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/handlers.rs')
-rw-r--r--helix-view/src/handlers.rs31
1 files changed, 9 insertions, 22 deletions
diff --git a/helix-view/src/handlers.rs b/helix-view/src/handlers.rs
index 6f3ad1ed..93336beb 100644
--- a/helix-view/src/handlers.rs
+++ b/helix-view/src/handlers.rs
@@ -1,15 +1,12 @@
-use completion::{CompletionEvent, CompletionHandler};
use helix_event::send_blocking;
use tokio::sync::mpsc::Sender;
use crate::handlers::lsp::SignatureHelpInvoked;
use crate::{DocumentId, Editor, ViewId};
-pub mod completion;
pub mod dap;
pub mod diagnostics;
pub mod lsp;
-pub mod word_index;
#[derive(Debug)]
pub enum AutoSaveEvent {
@@ -19,23 +16,22 @@ pub enum AutoSaveEvent {
pub struct Handlers {
// only public because most of the actual implementation is in helix-term right now :/
- pub completions: CompletionHandler,
+ pub completions: Sender<lsp::CompletionEvent>,
pub signature_hints: Sender<lsp::SignatureHelpEvent>,
pub auto_save: Sender<AutoSaveEvent>,
- pub document_colors: Sender<lsp::DocumentColorsEvent>,
- pub word_index: word_index::Handler,
- pub pull_diagnostics: Sender<lsp::PullDiagnosticsEvent>,
- pub pull_all_documents_diagnostics: Sender<lsp::PullAllDocumentsDiagnosticsEvent>,
}
impl Handlers {
/// Manually trigger completion (c-x)
pub fn trigger_completions(&self, trigger_pos: usize, doc: DocumentId, view: ViewId) {
- self.completions.event(CompletionEvent::ManualTrigger {
- cursor: trigger_pos,
- doc,
- view,
- });
+ send_blocking(
+ &self.completions,
+ lsp::CompletionEvent::ManualTrigger {
+ cursor: trigger_pos,
+ doc,
+ view,
+ },
+ );
}
pub fn trigger_signature_help(&self, invocation: SignatureHelpInvoked, editor: &Editor) {
@@ -50,13 +46,4 @@ impl Handlers {
};
send_blocking(&self.signature_hints, event)
}
-
- pub fn word_index(&self) -> &word_index::WordIndex {
- &self.word_index.index
- }
-}
-
-pub fn register_hooks(handlers: &Handlers) {
- lsp::register_hooks(handlers);
- word_index::register_hooks(handlers);
}