From 895238088417b292e35705e72182ff8cc3ab6f63 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 1 Nov 2019 20:01:21 +0100 Subject: Change SourceAnalyzer method resoltion API --- crates/ra_ide_api/src/completion/complete_dot.rs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'crates/ra_ide_api/src/completion/complete_dot.rs') diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index fe32e7366..b4df6ee2a 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide_api/src/completion/complete_dot.rs @@ -58,21 +58,13 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) { let mut seen_methods = FxHashSet::default(); - ctx.analyzer.iterate_method_candidates( - ctx.db, - receiver, - None, - hir::LookupMode::MethodCall, - |_ty, item| { - if let hir::AssocItem::Function(func) = item { - let data = func.data(ctx.db); - if data.has_self_param() && seen_methods.insert(data.name().clone()) { - acc.add_function(ctx, func); - } - } - None::<()> - }, - ); + ctx.analyzer.iterate_method_candidates(ctx.db, receiver, None, |_ty, func| { + let data = func.data(ctx.db); + if data.has_self_param() && seen_methods.insert(data.name().clone()) { + acc.add_function(ctx, func); + } + None::<()> + }); } #[cfg(test)] -- cgit v1.2.3