Unnamed repository; edit this file 'description' to name the repository.
Check for rename support before showing LSP rename prompt (#9277)
Michael Davis 2024-01-09
parent 4da6191 · commit 0cbd8d3
-rw-r--r--helix-term/src/commands/lsp.rs10
1 files changed, 10 insertions, 0 deletions
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| {