aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src/lib.rs
diff options
context:
space:
mode:
authorGabriel Lopes Rodrigues2024-01-02 15:29:22 +0000
committerGitHub2024-01-02 15:29:22 +0000
commit7fd266efa9b90861f585d0cd7366c94bbeeaa81a (patch)
tree502b07caa241cc6e54b5efae23858a07f8b1f2c6 /helix-lsp/src/lib.rs
parent85fce2f5b6c9f35ab9d3361f3933288a28db83d4 (diff)
Avoid crashing with 2 instances of the same LSP (#9134)
Diffstat (limited to 'helix-lsp/src/lib.rs')
-rw-r--r--helix-lsp/src/lib.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs
index b6a99065..34278cd5 100644
--- a/helix-lsp/src/lib.rs
+++ b/helix-lsp/src/lib.rs
@@ -915,10 +915,17 @@ fn start_client(
}
// next up, notify<initialized>
- _client
+ let notification_result = _client
.notify::<lsp::notification::Initialized>(lsp::InitializedParams {})
- .await
- .unwrap();
+ .await;
+
+ if let Err(e) = notification_result {
+ log::error!(
+ "failed to notify language server of its initialization: {}",
+ e
+ );
+ return;
+ }
initialize_notify.notify_one();
});