summaryrefslogtreecommitdiff
path: root/helix-lsp/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-lsp/src/lib.rs')
-rw-r--r--helix-lsp/src/lib.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs
index 6adaa3f8..1bab2a17 100644
--- a/helix-lsp/src/lib.rs
+++ b/helix-lsp/src/lib.rs
@@ -130,10 +130,10 @@ pub enum Notification {
}
impl Notification {
- pub fn parse(method: &str, params: jsonrpc::Params) -> Notification {
+ pub fn parse(method: &str, params: jsonrpc::Params) -> Option<Notification> {
use lsp::notification::Notification as _;
- match method {
+ let notification = match method {
lsp::notification::PublishDiagnostics::METHOD => {
let params: lsp::PublishDiagnosticsParams = params
.parse()
@@ -155,8 +155,13 @@ impl Notification {
Notification::LogMessage(params)
}
- _ => unimplemented!("unhandled notification: {}", method),
- }
+ _ => {
+ log::error!("unhandled LSP notification: {}", method);
+ return None;
+ }
+ };
+
+ Some(notification)
}
}