aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands/typed.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands/typed.rs')
-rw-r--r--helix-term/src/commands/typed.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index b78de772..38058ed5 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1330,14 +1330,16 @@ fn lsp_workspace_command(
return Ok(());
}
let doc = doc!(cx.editor);
- let language_servers =
- doc.language_servers_with_feature(LanguageServerFeature::WorkspaceCommand);
- let (language_server_id, options) = match language_servers.iter().find_map(|ls| {
- ls.capabilities()
- .execute_command_provider
- .as_ref()
- .map(|options| (ls.id(), options))
- }) {
+ let id_options = doc
+ .language_servers_with_feature(LanguageServerFeature::WorkspaceCommand)
+ .find_map(|ls| {
+ ls.capabilities()
+ .execute_command_provider
+ .as_ref()
+ .map(|options| (ls.id(), options))
+ });
+
+ let (language_server_id, options) = match id_options {
Some(id_options) => id_options,
None => {
cx.editor.set_status(
@@ -1346,6 +1348,7 @@ fn lsp_workspace_command(
return Ok(());
}
};
+
if args.is_empty() {
let commands = options
.commands
@@ -1445,7 +1448,6 @@ fn lsp_stop(
// I'm not sure if this is really what we want
let ls_shutdown_names = doc
.language_servers()
- .iter()
.map(|ls| ls.name())
.collect::<Vec<_>>();
@@ -1459,7 +1461,6 @@ fn lsp_stop(
.filter_map(|doc| {
let doc_active_ls_ids: Vec<_> = doc
.language_servers()
- .iter()
.filter(|ls| !ls_shutdown_names.contains(&ls.name()))
.map(|ls| ls.id())
.collect();
@@ -1472,7 +1473,7 @@ fn lsp_stop(
.map(Clone::clone)
.collect();
- if active_clients.len() != doc.language_servers().len() {
+ if active_clients.len() != doc.language_servers().count() {
Some((doc.id(), active_clients))
} else {
None
@@ -1485,7 +1486,6 @@ fn lsp_stop(
let stopped_clients: Vec<_> = doc
.language_servers()
- .iter()
.filter(|ls| {
!active_clients
.iter()