Skip to content

Commit

Permalink
Check for rename support before showing LSP rename prompt (#9277)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored Jan 9, 2024
1 parent 4da6191 commit 0cbd8d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down

0 comments on commit 0cbd8d3

Please sign in to comment.