diff options
Diffstat (limited to 'helix-term/src/commands/typed.rs')
-rw-r--r-- | helix-term/src/commands/typed.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 8cfc9fd2..9ab2aa4f 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1330,23 +1330,19 @@ fn lsp_workspace_command( return Ok(()); } let doc = doc!(cx.editor); - let id_options = doc + let Some((language_server_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( - "No active language servers for this document support workspace commands", - ); - return Ok(()); - } + }) + else { + cx.editor.set_status( + "No active language servers for this document support workspace commands", + ); + return Ok(()); }; if args.is_empty() { |