From 0cbd8d3df1ec6faa088f4439e52865f8daf78dc3 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 8 Jan 2024 19:55:11 -0500 Subject: Check for rename support before showing LSP rename prompt (#9277) --- helix-term/src/commands/lsp.rs | 10 ++++++++++ 1 file changed, 10 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 ac6a1a21..34ffa529 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -1421,6 +1421,16 @@ pub fn rename_symbol(cx: &mut Context) { let (view, doc) = current_ref!(cx.editor); + if doc + .language_servers_with_feature(LanguageServerFeature::RenameSymbol) + .next() + .is_none() + { + cx.editor + .set_error("No configured language server supports symbol renaming"); + return; + } + let language_server_with_prepare_rename_support = doc .language_servers_with_feature(LanguageServerFeature::RenameSymbol) .find(|ls| { -- cgit v1.2.3-70-g09d2