aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/handlers')
-rw-r--r--crates/assists/src/handlers/remove_unused_param.rs33
1 files changed, 33 insertions, 0 deletions
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) }
128"#, 128"#,
129 ); 129 );
130 } 130 }
131
132 #[test]
133 fn remove_across_files() {
134 check_assist(
135 remove_unused_param,
136 r#"
137//- /main.rs
138fn foo(x: i32, <|>y: i32) { x; }
139
140mod foo;
141
142//- /foo.rs
143use super::foo;
144
145fn bar() {
146 let _ = foo(1, 2);
147}
148"#,
149 r#"
150//- /main.rs
151fn foo(x: i32) { x; }
152
153mod foo;
154
155//- /foo.rs
156use super::foo;
157
158fn bar() {
159 let _ = foo(1);
160}
161"#,
162 )
163 }
131} 164}