diff options
author | Timothy DeHerrera | 2021-08-23 09:04:22 +0000 |
---|---|---|
committer | GitHub | 2021-08-23 09:04:22 +0000 |
commit | ed8c3e6574eff6decabd50edfb74e638c44fcedf (patch) | |
tree | 994b3410c1634a2633c15ef856b31f89d31b7c15 | |
parent | 6dd7dc4eb2d50a9027caef4acc5e0bcc957d9280 (diff) |
don't panic on defunct lsp process (#583)
-rw-r--r-- | helix-lsp/src/transport.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs index 0710b449..5be694c8 100644 --- a/helix-lsp/src/transport.rs +++ b/helix-lsp/src/transport.rs @@ -222,10 +222,13 @@ impl Transport { loop { match Self::recv_server_message(&mut server_stdout, &mut recv_buffer).await { Ok(msg) => { - transport - .process_server_message(&client_tx, msg) - .await - .unwrap(); + match transport.process_server_message(&client_tx, msg).await { + Ok(_) => {} + Err(err) => { + error!("err: <- {:?}", err); + break; + } + }; } Err(err) => { error!("err: <- {:?}", err); @@ -254,10 +257,15 @@ impl Transport { mut client_rx: UnboundedReceiver<Payload>, ) { while let Some(msg) = client_rx.recv().await { - transport + match transport .send_payload_to_server(&mut server_stdin, msg) .await - .unwrap() + { + Ok(_) => {} + Err(err) => { + error!("err: <- {:?}", err); + } + } } } } |