From d31bef7fea1aa0cc9455cf082825ccff9614ed5e Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 3 Dec 2021 10:05:27 +0900 Subject: 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. --- helix-lsp/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'helix-lsp/src') diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 7fa65928..15cae582 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -337,7 +337,10 @@ impl Registry { }) .await; - value.expect("failed to initialize capabilities"); + if let Err(e) = value { + log::error!("failed to initialize language server: {}", e); + return; + } // next up, notify _client -- cgit v1.2.3-70-g09d2