From cfe866a14c3d894d09601cd0d10993376b207c9a Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 6 Apr 2024 00:38:51 -0400 Subject: [PATCH] Handle partial failure when sending textDocument/didSave (#10168) --- helix-view/src/document.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 0c3a75f1bb0e..f26ba8b97851 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -961,13 +961,14 @@ impl Document { for (_, language_server) in language_servers { if !language_server.is_initialized() { - return Ok(event); + continue; } - if let Some(identifier) = &identifier { - if let Some(notification) = - language_server.text_document_did_save(identifier.clone(), &text) - { - notification.await?; + if let Some(notification) = identifier + .clone() + .and_then(|id| language_server.text_document_did_save(id, &text)) + { + if let Err(err) = notification.await { + log::error!("Failed to send textDocument/didSave: {err}"); } } }