mirror of
https://github.com/helix-editor/helix.git
synced 2025-10-06 00:13:28 +02:00
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.
This commit is contained in:
@@ -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| {
|
||||
|
Reference in New Issue
Block a user