Find original ast node before compute ref match in fn render

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
hi-rustin 2022-07-27 20:18:00 +08:00
parent 8e4d9b84fe
commit 349dfc7e95

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());
}
}
_ => (),
}