Skip to content

Commit

Permalink
Check for rename support before showing LSP rename prompt (helix-edit…
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored and Schuyler Mortimer committed Jul 10, 2024
1 parent 18ea1ad commit c77223f
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 @@ -1425,6 +1425,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 c77223f

Please sign in to comment.