diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-05 13:01:10 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-05 13:01:10 +0100 |
commit | f98d057218ca30d052da2a119fa0b3108ba3a091 (patch) | |
tree | a55c47121466610e54e1fbb1df490a121e3247cb /crates/ra_ide | |
parent | 913a623281ed4cd190ca04845c64e5054d176a2a (diff) | |
parent | 522d24a607c100fdc12fa6650807a1dfcb0f4b12 (diff) |
Merge #4755
4755: Inlay Hints: more directly account for self param r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/inlay_hints.rs | 3 |
1 files changed, 1 insertions, 2 deletions
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( | |||
149 | ast::Expr::MethodCallExpr(expr) => expr.arg_list()?.args(), | 149 | ast::Expr::MethodCallExpr(expr) => expr.arg_list()?.args(), |
150 | _ => return None, | 150 | _ => return None, |
151 | }; | 151 | }; |
152 | let args_count = args.clone().count(); | ||
153 | 152 | ||
154 | let fn_signature = get_fn_signature(sema, &expr)?; | 153 | let fn_signature = get_fn_signature(sema, &expr)?; |
155 | let n_params_to_skip = | 154 | let n_params_to_skip = |
156 | if fn_signature.has_self_param && fn_signature.parameter_names.len() > args_count { | 155 | if fn_signature.has_self_param && matches!(&expr, ast::Expr::MethodCallExpr(_)) { |
157 | 1 | 156 | 1 |
158 | } else { | 157 | } else { |
159 | 0 | 158 | 0 |