aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/inlay_hints.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/inlay_hints.rs')
-rw-r--r--crates/ra_ide/src/inlay_hints.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs
index 75bd3c96b..7eb2cef73 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
@@ -416,7 +415,7 @@ struct Test<K, T = u8> {
416} 415}
417 416
418fn main() { 417fn main() {
419 let zz = Test { t: 23, k: 33 }; 418 let zz = Test { t: 23u8, k: 33 };
420 let zz_ref = &zz; 419 let zz_ref = &zz;
421}"#, 420}"#,
422 ); 421 );
@@ -429,7 +428,7 @@ fn main() {
429 label: "Test<i32>", 428 label: "Test<i32>",
430 }, 429 },
431 InlayHint { 430 InlayHint {
432 range: 105..111, 431 range: 107..113,
433 kind: TypeHint, 432 kind: TypeHint,
434 label: "&Test<i32>", 433 label: "&Test<i32>",
435 }, 434 },