mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-25 11:17:13 +00:00
Merge pull request #20333 from Veykril/push-xmulpqkxrytn
fix: Do not require all rename definitions to be renameable
This commit is contained in:
commit
4bcc293637
@ -35,13 +35,8 @@ pub(crate) fn prepare_rename(
|
||||
let syntax = source_file.syntax();
|
||||
|
||||
let res = find_definitions(&sema, syntax, position, &Name::new_symbol_root(sym::underscore))?
|
||||
.map(|(frange, kind, def, _, _)| {
|
||||
// ensure all ranges are valid
|
||||
|
||||
if def.range_for_rename(&sema).is_none() {
|
||||
bail!("No references found at position")
|
||||
}
|
||||
|
||||
.filter(|(_, _, def, _, _)| def.range_for_rename(&sema).is_some())
|
||||
.map(|(frange, kind, _, _, _)| {
|
||||
always!(
|
||||
frange.range.contains_inclusive(position.offset)
|
||||
&& frange.file_id == position.file_id
|
||||
|
Loading…
x
Reference in New Issue
Block a user