Skip to content

Commit 0e71356

Browse files
committed
Auto merge of #12800 - hi-rustin:rustin-patch-issue-12717, r=hi-rustin
Find original as node before compute ref match part of #12717
2 parents 30c4db1 + 15016bc commit 0e71356

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/ide-completion/src/render.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ pub(crate) fn render_field(
134134
.lookup_by(name.clone());
135135
item.insert_text(escaped_name);
136136
if let Some(receiver) = &dot_access.receiver {
137-
if let Some(ref_match) = compute_ref_match(ctx.completion, ty) {
138-
item.ref_match(ref_match, receiver.syntax().text_range().start());
137+
if let Some(original) = ctx.completion.sema.original_ast_node(receiver.clone()) {
138+
if let Some(ref_match) = compute_ref_match(ctx.completion, ty) {
139+
item.ref_match(ref_match, original.syntax().text_range().start());
140+
}
139141
}
140142
}
141143
item.build()

0 commit comments

Comments
 (0)