Auto merge of #12830 - hi-rustin:rustin-patch-issue-12717-fix, r=Veykril

Find original ast node before compute ref match

ref https://github.com/rust-lang/rust-analyzer/issues/12717
This commit is contained in:
bors 2022-07-27 12:31:26 +00:00
commit b4d652aa40

View File

@ -85,7 +85,9 @@ fn render(
item.ref_match(ref_match, path_ctx.path.syntax().text_range().start());
}
FuncKind::Method(DotAccess { receiver: Some(receiver), .. }, _) => {
item.ref_match(ref_match, receiver.syntax().text_range().start());
if let Some(original_expr) = completion.sema.original_ast_node(receiver.clone()) {
item.ref_match(ref_match, original_expr.syntax().text_range().start());
}
}
_ => (),
}