mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Merge pull request #19750 from Veykril/push-zvvsopwxovrn
fix: Remove unnecessary token length check for macros in renaming
This commit is contained in:
commit
d7e977a8f1
@ -390,11 +390,6 @@ pub fn source_edit_from_references(
|
|||||||
let mut edited_ranges = Vec::new();
|
let mut edited_ranges = Vec::new();
|
||||||
for &FileReference { range, ref name, .. } in references {
|
for &FileReference { range, ref name, .. } in references {
|
||||||
let name_range = name.text_range();
|
let name_range = name.text_range();
|
||||||
if name_range.len() != range.len() {
|
|
||||||
// This usage comes from a different token kind that was downmapped to a NameLike in a macro
|
|
||||||
// Renaming this will most likely break things syntax-wise
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let has_emitted_edit = match name {
|
let has_emitted_edit = match name {
|
||||||
// if the ranges differ then the node is inside a macro call, we can't really attempt
|
// if the ranges differ then the node is inside a macro call, we can't really attempt
|
||||||
// to make special rewrites like shorthand syntax and such, so just rename the node in
|
// to make special rewrites like shorthand syntax and such, so just rename the node in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user