Bail if no language servers support workspace symbols (#7286)
commitd4427125eb9f1f6936fae4c8569feb0893b76155
authorMichael Davis <mcarsondavis@gmail.com>
dateWed 7 Jun 2023, 19:48 (3 years ago)
parent31b8b72
helix-term/src/commands/lsp.rs+9
@@ -442,6 +442,15 @@ pub fn symbol_picker(cx: &mut Context) {
442442
443443pub fn workspace_symbol_picker(cx: &mut Context) {
444444 let doc = doc!(cx.editor);
445+ if doc
446+ .language_servers_with_feature(LanguageServerFeature::WorkspaceSymbols)
447+ .count()
448+ == 0
449+ {
450+ cx.editor
451+ .set_error("No configured language server supports workspace symbols");
452+ return;
453+ }
445454
446455 let get_symbols = move |pattern: String, editor: &mut Editor| {
447456 let doc = doc!(editor);