aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-lsp/src/transport.rs13
-rw-r--r--helix-term/src/application.rs10
2 files changed, 15 insertions, 8 deletions
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs
index 9fdd30aa..f2f35d6a 100644
--- a/helix-lsp/src/transport.rs
+++ b/helix-lsp/src/transport.rs
@@ -270,7 +270,14 @@ impl Transport {
}
};
}
- Err(Error::StreamClosed) => {
+ Err(err) => {
+ if !matches!(err, Error::StreamClosed) {
+ error!(
+ "Exiting {} after unexpected error: {err:?}",
+ &transport.name
+ );
+ }
+
// Close any outstanding requests.
for (id, tx) in transport.pending_requests.lock().await.drain() {
match tx.send(Err(Error::StreamClosed)).await {
@@ -300,10 +307,6 @@ impl Transport {
}
break;
}
- Err(err) => {
- error!("{} err: <- {err:?}", transport.name);
- break;
- }
}
}
}
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 4eda8097..01c120d0 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -27,7 +27,7 @@ use crate::{
ui::{self, overlay::overlaid},
};
-use log::{debug, error, warn};
+use log::{debug, error, info, warn};
#[cfg(not(feature = "integration"))]
use std::io::stdout;
use std::{collections::btree_map::Entry, io::stdin, path::Path, sync::Arc};
@@ -683,9 +683,13 @@ impl Application {
Call::Notification(helix_lsp::jsonrpc::Notification { method, params, .. }) => {
let notification = match Notification::parse(&method, params) {
Ok(notification) => notification,
+ Err(helix_lsp::Error::Unhandled) => {
+ info!("Ignoring Unhandled notification from Language Server");
+ return;
+ }
Err(err) => {
- log::error!(
- "received malformed notification from Language Server: {}",
+ error!(
+ "Ignoring unknown notification from Language Server: {}",
err
);
return;