Check for rename support before showing LSP rename prompt (#9277)

This commit is contained in:
Michael Davis 2024-01-08 19:55:11 -05:00 committed by GitHub
parent 4da6191a1c
commit 0cbd8d3df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1421,6 +1421,16 @@ fn create_rename_prompt(
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| {