From 1c3a1385a587f0713908c0ae888ffad31f13de11 Mon Sep 17 00:00:00 2001 From: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Date: Tue, 21 Apr 2020 14:31:57 +0200 Subject: Improve autocompletion by looking on the type and name Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> --- crates/ra_ide/src/display/function_signature.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ra_ide/src/display/function_signature.rs') diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs index 2d175882b..b5e2785fe 100644 --- a/crates/ra_ide/src/display/function_signature.rs +++ b/crates/ra_ide/src/display/function_signature.rs @@ -73,7 +73,7 @@ impl FunctionSignature { if let Some(param_type) = raw_param.split(':').nth(1) { parameter_types.push(param_type[1..].to_string()); } else { - // The unwrap_or_else is useful when you have tuple struct + // useful when you have tuple struct parameter_types.push(raw_param.clone()); } params.push(raw_param); @@ -177,7 +177,6 @@ impl From<&'_ ast::FnDef> for FunctionSignature { has_self_param = true; let raw_param = self_param.syntax().text().to_string(); - // FIXME: better solution ? res_types.push( raw_param.split(':').nth(1).unwrap_or_else(|| " Self")[1..].to_string(), ); -- cgit v1.2.3