aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/handlers.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-11-30 23:03:27 +0000
committerBlaž Hrastnik2024-01-23 02:20:19 +0000
commit8e592a151fe7adfbf3fb35ae134b7f2a70700f09 (patch)
tree603a94042068620e52f50cb26cf881d5461d1c8d /helix-term/src/handlers.rs
parent13ed4f6c4748019787d24c2b686d417b71604242 (diff)
refactor completion and signature help using hooks
Diffstat (limited to 'helix-term/src/handlers.rs')
-rw-r--r--helix-term/src/handlers.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/helix-term/src/handlers.rs b/helix-term/src/handlers.rs
index ab2d724f..ef5369f8 100644
--- a/helix-term/src/handlers.rs
+++ b/helix-term/src/handlers.rs
@@ -1,15 +1,30 @@
use std::sync::Arc;
use arc_swap::ArcSwap;
+use helix_event::AsyncHook;
use crate::config::Config;
use crate::events;
+use crate::handlers::completion::CompletionHandler;
+use crate::handlers::signature_help::SignatureHelpHandler;
+pub use completion::trigger_auto_completion;
+pub use helix_view::handlers::lsp::SignatureHelpInvoked;
+pub use helix_view::handlers::Handlers;
+
+mod completion;
+mod signature_help;
- }
pub fn setup(config: Arc<ArcSwap<Config>>) -> Handlers {
events::register();
+
+ let completions = CompletionHandler::new(config).spawn();
+ let signature_hints = SignatureHelpHandler::new().spawn();
let handlers = Handlers {
+ completions,
+ signature_hints,
};
+ completion::register_hooks(&handlers);
+ signature_help::register_hooks(&handlers);
handlers
}