From 522d24a607c100fdc12fa6650807a1dfcb0f4b12 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 5 Jun 2020 13:58:52 +0200 Subject: Inlay Hints: more directly account for self param --- crates/ra_ide/src/inlay_hints.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 75bd3c96b..49366de98 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs @@ -149,11 +149,10 @@ fn get_param_name_hints( ast::Expr::MethodCallExpr(expr) => expr.arg_list()?.args(), _ => return None, }; - let args_count = args.clone().count(); let fn_signature = get_fn_signature(sema, &expr)?; let n_params_to_skip = - if fn_signature.has_self_param && fn_signature.parameter_names.len() > args_count { + if fn_signature.has_self_param && matches!(&expr, ast::Expr::MethodCallExpr(_)) { 1 } else { 0 -- cgit v1.2.3