diff options
author | Florian Diebold <[email protected]> | 2019-10-31 18:28:33 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-11-01 18:57:08 +0000 |
commit | 1173c3dab5f77a1afd367d547790dd82c558fe0d (patch) | |
tree | 50d39c98ad4ac7deae11800d20c0a5dbeb9ed8bc /crates/ra_ide_api/src | |
parent | c7cedea270c492e9a2c8b81c1312fda44fd8217e (diff) |
Refactor to unify with method resolution
Diffstat (limited to 'crates/ra_ide_api/src')
-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 | }); |