diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/assists/src/handlers/remove_unused_param.rs | 33 |
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 | ||
138 | fn foo(x: i32, <|>y: i32) { x; } | ||
139 | |||
140 | mod foo; | ||
141 | |||
142 | //- /foo.rs | ||
143 | use super::foo; | ||
144 | |||
145 | fn bar() { | ||
146 | let _ = foo(1, 2); | ||
147 | } | ||
148 | "#, | ||
149 | r#" | ||
150 | //- /main.rs | ||
151 | fn foo(x: i32) { x; } | ||
152 | |||
153 | mod foo; | ||
154 | |||
155 | //- /foo.rs | ||
156 | use super::foo; | ||
157 | |||
158 | fn bar() { | ||
159 | let _ = foo(1); | ||
160 | } | ||
161 | "#, | ||
162 | ) | ||
163 | } | ||
131 | } | 164 | } |