From d4427125eb9f1f6936fae4c8569feb0893b76155 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 7 Jun 2023 19:48:11 -0500 Subject: Bail if no language servers support workspace symbols (#7286) --- helix-term/src/commands/lsp.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'helix-term/src/commands/lsp.rs') diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 3596df45..8c3fd13b 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -442,6 +442,15 @@ pub fn symbol_picker(cx: &mut Context) { pub fn workspace_symbol_picker(cx: &mut Context) { let doc = doc!(cx.editor); + if doc + .language_servers_with_feature(LanguageServerFeature::WorkspaceSymbols) + .count() + == 0 + { + cx.editor + .set_error("No configured language server supports workspace symbols"); + return; + } let get_symbols = move |pattern: String, editor: &mut Editor| { let doc = doc!(editor); -- cgit v1.2.3-70-g09d2