diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_dot.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_dot.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index 473edc50e..76c2f8173 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide_api/src/completion/complete_dot.rs | |||
@@ -24,7 +24,9 @@ pub(super) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) { | |||
24 | fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) { | 24 | fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) { |
25 | for receiver in receiver.autoderef(ctx.db) { | 25 | for receiver in receiver.autoderef(ctx.db) { |
26 | match receiver { | 26 | match receiver { |
27 | Ty::Adt { def_id, .. } => { | 27 | Ty::Adt { |
28 | def_id, ref substs, .. | ||
29 | } => { | ||
28 | match def_id.resolve(ctx.db) { | 30 | match def_id.resolve(ctx.db) { |
29 | Def::Struct(s) => { | 31 | Def::Struct(s) => { |
30 | for field in s.fields(ctx.db) { | 32 | for field in s.fields(ctx.db) { |
@@ -33,7 +35,7 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) | |||
33 | field.name().to_string(), | 35 | field.name().to_string(), |
34 | ) | 36 | ) |
35 | .kind(CompletionItemKind::Field) | 37 | .kind(CompletionItemKind::Field) |
36 | .set_detail(field.ty(ctx.db).map(|ty| ty.to_string())) | 38 | .set_detail(field.ty(ctx.db).map(|ty| ty.subst(substs).to_string())) |
37 | .add_to(acc); | 39 | .add_to(acc); |
38 | } | 40 | } |
39 | } | 41 | } |