Skip to content

Commit

Permalink
Handle partial failure when sending textDocument/didSave
Browse files Browse the repository at this point in the history
One language server being uninitialized or exited should not prevent
the other(s) from being notified of didSave.
  • Loading branch information
the-mikedavis committed Apr 4, 2024
1 parent 962c714 commit 081e343
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions helix-view/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
}
}
Expand Down

0 comments on commit 081e343

Please sign in to comment.