mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
Merge pull request #20333 from Veykril/push-xmulpqkxrytn
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Do not require all rename definitions to be renameable
This commit is contained in:
commit
4bcc293637
1 changed files with 2 additions and 7 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue