Skip to content

Commit

Permalink
Update helix-term/src/commands/typed.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Davis <[email protected]>
  • Loading branch information
mangas and the-mikedavis committed Aug 25, 2022
1 parent a023177 commit 738722f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,7 @@ fn lsp_restart(
cx.editor.language_servers.restart(config)?;

// This collect is needed because refresh_language_server would need to re-borrow editor.
#[allow(clippy::needless_collect)]
let to_refresh: Vec<DocumentId> = cx
let document_ids_to_refresh: Vec<DocumentId> = cx
.editor
.documents()
.filter_map(|doc| match doc.language_config() {
Expand All @@ -1010,9 +1009,9 @@ fn lsp_restart(
})
.collect();

to_refresh.into_iter().for_each(|id| {
cx.editor.refresh_language_server(id);
});
for document_id in document_ids_to_refresh {
cx.editor.refresh_language_server(document_id);
}

Ok(())
}
Expand Down

0 comments on commit 738722f

Please sign in to comment.