aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2020-11-09 18:06:11 +0000
committerLukas Wirth <[email protected]>2020-11-09 18:06:11 +0000
commit949c580d1bc5bcf6d8bc1bec1c85f879166f7d73 (patch)
tree7835568aa904f87fa07507cf596afb6e90cdc80a /crates
parentd5775b320c4f274c77b38f01b39ea96336f046bb (diff)
Add multiple file edit tes to remove_unused_param assist
Diffstat (limited to 'crates')
-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}