diff options
author | Lukas Wirth <[email protected]> | 2020-11-09 18:06:11 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-11-09 18:06:11 +0000 |
commit | 949c580d1bc5bcf6d8bc1bec1c85f879166f7d73 (patch) | |
tree | 7835568aa904f87fa07507cf596afb6e90cdc80a /crates/assists/src | |
parent | d5775b320c4f274c77b38f01b39ea96336f046bb (diff) |
Add multiple file edit tes to remove_unused_param assist
Diffstat (limited to 'crates/assists/src')
-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 | } |