Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/mod.rs')
-rw-r--r--helix-term/src/ui/mod.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index 6a4655fd..0a65b12b 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -364,14 +364,16 @@ pub mod completers {
}
pub fn lsp_workspace_command(editor: &Editor, input: &str) -> Vec<Completion> {
- let Some(options) = doc!(editor)
+ let commands = doc!(editor)
.language_servers_with_feature(LanguageServerFeature::WorkspaceCommand)
- .find_map(|ls| ls.capabilities().execute_command_provider.as_ref())
- else {
- return vec![];
- };
-
- fuzzy_match(input, &options.commands, false)
+ .flat_map(|ls| {
+ ls.capabilities()
+ .execute_command_provider
+ .iter()
+ .flat_map(|options| options.commands.iter())
+ });
+
+ fuzzy_match(input, commands, false)
.into_iter()
.map(|(name, _)| ((0..), name.to_owned().into()))
.collect()