diff --git a/crates/ide_assists/src/handlers/remove_unused_param.rs b/crates/ide_assists/src/handlers/remove_unused_param.rs index fabfe7e93df..3cb2a1b6e31 100644 --- a/crates/ide_assists/src/handlers/remove_unused_param.rs +++ b/crates/ide_assists/src/handlers/remove_unused_param.rs @@ -310,6 +310,36 @@ use super::foo; fn bar() { let _ = foo(1); } +"#, + ) + } + + #[test] + fn remove_method_param() { + // FIXME: This is completely wrong: + // * method call expressions are not handled + // * assoc function syntax removes the wrong argument. + check_assist( + remove_unused_param, + r#" +struct S; +impl S { fn f(&self, $0_unused: i32) {} } +fn main() { + S.f(92); + S.f(); + S.f(92, 92); + S::f(&S, 92); +} +"#, + r#" +struct S; +impl S { fn f(&self) {} } +fn main() { + S.f(92); + S.f(); + S.f(92, 92); + S::f(92); +} "#, ) }