aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src/transport.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-lsp/src/transport.rs')
-rw-r--r--helix-lsp/src/transport.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs
index 68b3d15e..3e3e06ee 100644
--- a/helix-lsp/src/transport.rs
+++ b/helix-lsp/src/transport.rs
@@ -251,6 +251,16 @@ impl Transport {
};
}
Err(Error::StreamClosed) => {
+ // Close any outstanding requests.
+ for (id, tx) in transport.pending_requests.lock().await.drain() {
+ match tx.send(Err(Error::StreamClosed)).await {
+ Ok(_) => (),
+ Err(_) => {
+ error!("Could not close request on a closed channel (id={:?})", id)
+ }
+ }
+ }
+
// Hack: inject a terminated notification so we trigger code that needs to happen after exit
use lsp_types::notification::Notification as _;
let notification =