From 949c580d1bc5bcf6d8bc1bec1c85f879166f7d73 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 9 Nov 2020 19:06:11 +0100 Subject: Add multiple file edit tes to remove_unused_param assist --- crates/assists/src/handlers/remove_unused_param.rs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'crates/assists') diff --git a/crates/assists/src/handlers/remove_unused_param.rs b/crates/assists/src/handlers/remove_unused_param.rs index 5fccca54b..a4bbf2e9e 100644 --- a/crates/assists/src/handlers/remove_unused_param.rs +++ b/crates/assists/src/handlers/remove_unused_param.rs @@ -128,4 +128,37 @@ fn main() { foo(9, 2) } "#, ); } + + #[test] + fn remove_across_files() { + check_assist( + remove_unused_param, + r#" +//- /main.rs +fn foo(x: i32, <|>y: i32) { x; } + +mod foo; + +//- /foo.rs +use super::foo; + +fn bar() { + let _ = foo(1, 2); +} +"#, + r#" +//- /main.rs +fn foo(x: i32) { x; } + +mod foo; + +//- /foo.rs +use super::foo; + +fn bar() { + let _ = foo(1); +} +"#, + ) + } } -- cgit v1.2.3