diff options
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_dot.rs | 6 | ||||
-rw-r--r-- | crates/ra_ide_api/src/db.rs | 1 |
2 files changed, 5 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 | } |
diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs index c2978f909..a1b666899 100644 --- a/crates/ra_ide_api/src/db.rs +++ b/crates/ra_ide_api/src/db.rs | |||
@@ -129,6 +129,7 @@ salsa::database_storage! { | |||
129 | fn body_hir() for hir::db::BodyHirQuery; | 129 | fn body_hir() for hir::db::BodyHirQuery; |
130 | fn body_syntax_mapping() for hir::db::BodySyntaxMappingQuery; | 130 | fn body_syntax_mapping() for hir::db::BodySyntaxMappingQuery; |
131 | fn fn_signature() for hir::db::FnSignatureQuery; | 131 | fn fn_signature() for hir::db::FnSignatureQuery; |
132 | fn generic_params() for hir::db::GenericParamsQuery; | ||
132 | } | 133 | } |
133 | } | 134 | } |
134 | } | 135 | } |