aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorMichael Davis2024-01-09 00:55:11 +0000
committerGitHub2024-01-09 00:55:11 +0000
commit0cbd8d3df1ec6faa088f4439e52865f8daf78dc3 (patch)
treea3a08d3fff9ea11b6b1721e667f7f9779cfea4ce /helix-term
parent4da6191a1c821eaff580392b41a2eb7245a475b7 (diff)
Check for rename support before showing LSP rename prompt (#9277)
Diffstat (limited to 'helix-term')
-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| {