Unnamed repository; edit this file 'description' to name the repository.
Show successfully requested code actions after a failed request (#13156)
When requesting code actions from multiple LSP servers, rather than bailing as soon as an error is encountered, instead log the error and then keep going so that successful requests can be presented to the user.
Ian Hobson 11 months ago
parent 1dee64f · commit 1c9a5bd
-rw-r--r--helix-term/src/commands/lsp.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index f9603166..7464d105 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -745,9 +745,12 @@ pub fn code_action(cx: &mut Context) {
cx.jobs.callback(async move {
let mut actions = Vec::new();
- // TODO if one code action request errors, all other requests are ignored (even if they're valid)
- while let Some(mut lsp_items) = futures.try_next().await? {
- actions.append(&mut lsp_items);
+
+ while let Some(output) = futures.next().await {
+ match output {
+ Ok(mut lsp_items) => actions.append(&mut lsp_items),
+ Err(err) => log::error!("while gathering code actions: {err}"),
+ }
}
let call = move |editor: &mut Editor, compositor: &mut Compositor| {