@@ -251,6 +251,16 @@ impl Transport {
253 Err(Error::StreamClosed) => {
253 Err(Error::StreamClosed) => {
254+ // Close any outstanding requests.
255+ for (id, tx) in transport.pending_requests.lock().await.drain() {
256+ match tx.send(Err(Error::StreamClosed)).await {
259+ error!("Could not close request on a closed channel (id={:?})", id)
254 // Hack: inject a terminated notification so we trigger code that needs to happen after exit
264 // Hack: inject a terminated notification so we trigger code that needs to happen after exit
255 use lsp_types::notification::Notification as _;
265 use lsp_types::notification::Notification as _;
256 let notification =
266 let notification =