on master help sign in
lsp: Don't panic if init fails

We correctly filter out the language server inside Document to ignore it if the capabilities are missing, so this way it'll simply ignore the errored out LSP rather than panicking.

commitd31bef7fea1aa0cc9455cf082825ccff9614ed5e authorBlaž Hrastnik <blaz@mxxn.io> dateFri 3 Dec 2021, 10:05 (5 years ago) parent01f7a31
1 file changed+4−1
helix-lsp/src/lib.rs+4−1
helix-lsp/src/lib.rs+4−1
@@ -337,7 +337,10 @@ impl Registry {
337337 })
338338 .await;
339339
340− value.expect("failed to initialize capabilities");
340+ if let Err(e) = value {
341+ log::error!("failed to initialize language server: {}", e);
342+ return;
343+ }
341344
342345 // next up, notify<initialized>
343346 _client