mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-02 02:17:44 +03: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:
parent
1dee64f7ec
commit
1c9a5bd366
1 changed files with 6 additions and 3 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue