diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_dot.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index b4df6ee2a..7135f481d 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide_api/src/completion/complete_dot.rs | |||
@@ -58,10 +58,12 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) | |||
58 | 58 | ||
59 | fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) { | 59 | fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) { |
60 | let mut seen_methods = FxHashSet::default(); | 60 | let mut seen_methods = FxHashSet::default(); |
61 | ctx.analyzer.iterate_method_candidates(ctx.db, receiver, None, |_ty, func| { | 61 | ctx.analyzer.iterate_method_candidates(ctx.db, receiver, None, |_ty, item| { |
62 | let data = func.data(ctx.db); | 62 | if let hir::AssocItem::Function(func) = item { |
63 | if data.has_self_param() && seen_methods.insert(data.name().clone()) { | 63 | let data = func.data(ctx.db); |
64 | acc.add_function(ctx, func); | 64 | if data.has_self_param() && seen_methods.insert(data.name().clone()) { |
65 | acc.add_function(ctx, func); | ||
66 | } | ||
65 | } | 67 | } |
66 | None::<()> | 68 | None::<()> |
67 | }); | 69 | }); |