minor: use reference.range to get original range

This commit is contained in:
Young-Flash 2024-01-20 14:43:42 +08:00
parent 0bf986d718
commit f9b5e0d219

View File

@ -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;
} }