2023-12-01 00:03:26 +01:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
|
|
use arc_swap::ArcSwap;
|
2023-12-01 00:03:27 +01:00
|
|
|
use helix_event::AsyncHook;
|
2023-12-01 00:03:26 +01:00
|
|
|
|
|
|
|
use crate::config::Config;
|
|
|
|
use crate::events;
|
2023-12-01 00:03:27 +01:00
|
|
|
use crate::handlers::completion::CompletionHandler;
|
|
|
|
use crate::handlers::signature_help::SignatureHelpHandler;
|
2023-12-01 00:03:26 +01:00
|
|
|
|
2023-12-01 00:03:27 +01:00
|
|
|
pub use completion::trigger_auto_completion;
|
|
|
|
pub use helix_view::handlers::Handlers;
|
|
|
|
|
2024-04-21 16:14:39 +02:00
|
|
|
pub mod completion;
|
2023-12-01 00:03:27 +01:00
|
|
|
mod signature_help;
|
2023-12-01 00:03:26 +01:00
|
|
|
|
|
|
|
pub fn setup(config: Arc<ArcSwap<Config>>) -> Handlers {
|
|
|
|
events::register();
|
2023-12-01 00:03:27 +01:00
|
|
|
|
|
|
|
let completions = CompletionHandler::new(config).spawn();
|
|
|
|
let signature_hints = SignatureHelpHandler::new().spawn();
|
2023-12-01 00:03:26 +01:00
|
|
|
let handlers = Handlers {
|
2023-12-01 00:03:27 +01:00
|
|
|
completions,
|
|
|
|
signature_hints,
|
2023-12-01 00:03:26 +01:00
|
|
|
};
|
2023-12-01 00:03:27 +01:00
|
|
|
completion::register_hooks(&handlers);
|
|
|
|
signature_help::register_hooks(&handlers);
|
2023-12-01 00:03:26 +01:00
|
|
|
handlers
|
|
|
|
}
|