@@ -353,6 +353,11 @@ impl Transport {
356+ fn is_shutdown(payload: &Payload) -> bool {
357+ use lsp_types::request::{Request, Shutdown};
358+ matches!(payload, Payload::Request { value: jsonrpc::MethodCall { method, .. }, .. } if method == Shutdown::METHOD)
356 // TODO: events that use capabilities need to do the right thing
361 // TODO: events that use capabilities need to do the right thing
@@ -391,7 +396,10 @@ impl Transport {
392 msg = client_rx.recv() => {
397 msg = client_rx.recv() => {
393 if let Some(msg) = msg {
398 if let Some(msg) = msg {
399+ if is_pending && is_shutdown(&msg) {
400+ log::info!("Language server not initialized, shutting down");
394− if is_pending && !is_initialize(&msg) {
402+ } else if is_pending && !is_initialize(&msg) {
395 // ignore notifications
403 // ignore notifications
396 if let Payload::Notification(_) = msg {
404 if let Payload::Notification(_) = msg {
397 continue;
405 continue;