aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authormisiasty32023-03-13 15:29:23 +0000
committerGitHub2023-03-13 15:29:23 +0000
commitdb8e9f5bb2e2b9412cb1cc4688ad2febb726e48c (patch)
tree82a93e8720ea6fc2b441e7ec07a7335a5270e0a0 /helix-term
parentdc418bb50739c8063978f4200fcd9fcae73db002 (diff)
Check language server symbol renaming support before prompting (#6257)
Co-authored-by: Poliorcetics <poliorcetics@users.noreply.github.com>
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands/lsp.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index f9d9856f..f71aacf0 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -1316,6 +1316,12 @@ pub fn rename_symbol(cx: &mut Context) {
let language_server = language_server!(cx.editor, doc);
let offset_encoding = language_server.offset_encoding();
+ if !language_server.supports_rename() {
+ cx.editor
+ .set_error("Language server does not support symbol renaming");
+ return;
+ }
+
let pos = doc.position(view.id, offset_encoding);
match language_server.prepare_rename(doc.identifier(), pos) {