4755: Inlay Hints: more directly account for self param r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-06-05 12:01:10 +00:00 committed by GitHub
commit f98d057218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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