minor: use reference.range
to get original range
This commit is contained in:
parent
0bf986d718
commit
f9b5e0d219
@ -414,9 +414,8 @@ fn reference_to_node(
|
|||||||
reference.name.as_name_ref()?.syntax().parent().and_then(ast::PathSegment::cast)?;
|
reference.name.as_name_ref()?.syntax().parent().and_then(ast::PathSegment::cast)?;
|
||||||
|
|
||||||
// filter out the reference in marco
|
// filter out the reference in marco
|
||||||
let s_range = segment.syntax().text_range();
|
let segment_range = segment.syntax().text_range();
|
||||||
let origin_range = sema.original_range(segment.syntax()).range;
|
if segment_range != reference.range {
|
||||||
if s_range != origin_range {
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user