diff options
Diffstat (limited to 'crates/assists/src/handlers/merge_imports.rs')
-rw-r--r-- | crates/assists/src/handlers/merge_imports.rs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/crates/assists/src/handlers/merge_imports.rs b/crates/assists/src/handlers/merge_imports.rs index 2f0dc7831..7bd7e1e36 100644 --- a/crates/assists/src/handlers/merge_imports.rs +++ b/crates/assists/src/handlers/merge_imports.rs | |||
@@ -15,7 +15,7 @@ use crate::{ | |||
15 | // Merges two imports with a common prefix. | 15 | // Merges two imports with a common prefix. |
16 | // | 16 | // |
17 | // ``` | 17 | // ``` |
18 | // use std::<|>fmt::Formatter; | 18 | // use std::$0fmt::Formatter; |
19 | // use std::io; | 19 | // use std::io; |
20 | // ``` | 20 | // ``` |
21 | // -> | 21 | // -> |
@@ -75,7 +75,7 @@ mod tests { | |||
75 | check_assist( | 75 | check_assist( |
76 | merge_imports, | 76 | merge_imports, |
77 | r" | 77 | r" |
78 | use std::fmt<|>::{Display, Debug}; | 78 | use std::fmt$0::{Display, Debug}; |
79 | use std::fmt::{Display, Debug}; | 79 | use std::fmt::{Display, Debug}; |
80 | ", | 80 | ", |
81 | r" | 81 | r" |
@@ -89,7 +89,7 @@ use std::fmt::{Debug, Display}; | |||
89 | check_assist( | 89 | check_assist( |
90 | merge_imports, | 90 | merge_imports, |
91 | r" | 91 | r" |
92 | use std::fmt<|>::Debug; | 92 | use std::fmt$0::Debug; |
93 | use std::fmt::Display; | 93 | use std::fmt::Display; |
94 | ", | 94 | ", |
95 | r" | 95 | r" |
@@ -104,7 +104,7 @@ use std::fmt::{Debug, Display}; | |||
104 | merge_imports, | 104 | merge_imports, |
105 | r" | 105 | r" |
106 | use std::fmt::Debug; | 106 | use std::fmt::Debug; |
107 | use std::fmt<|>::Display; | 107 | use std::fmt$0::Display; |
108 | ", | 108 | ", |
109 | r" | 109 | r" |
110 | use std::fmt::{Debug, Display}; | 110 | use std::fmt::{Debug, Display}; |
@@ -117,7 +117,7 @@ use std::fmt::{Debug, Display}; | |||
117 | check_assist( | 117 | check_assist( |
118 | merge_imports, | 118 | merge_imports, |
119 | r" | 119 | r" |
120 | use std::fmt<|>; | 120 | use std::fmt$0; |
121 | use std::fmt::Display; | 121 | use std::fmt::Display; |
122 | ", | 122 | ", |
123 | r" | 123 | r" |
@@ -131,7 +131,7 @@ use std::fmt::{self, Display}; | |||
131 | check_assist( | 131 | check_assist( |
132 | merge_imports, | 132 | merge_imports, |
133 | r" | 133 | r" |
134 | use std::{fmt, <|>fmt::Display}; | 134 | use std::{fmt, $0fmt::Display}; |
135 | ", | 135 | ", |
136 | r" | 136 | r" |
137 | use std::{fmt::{self, Display}}; | 137 | use std::{fmt::{self, Display}}; |
@@ -144,7 +144,7 @@ use std::{fmt::{self, Display}}; | |||
144 | check_assist_not_applicable( | 144 | check_assist_not_applicable( |
145 | merge_imports, | 145 | merge_imports, |
146 | r" | 146 | r" |
147 | pub use std::fmt<|>::Debug; | 147 | pub use std::fmt$0::Debug; |
148 | use std::fmt::Display; | 148 | use std::fmt::Display; |
149 | ", | 149 | ", |
150 | ); | 150 | ); |
@@ -155,7 +155,7 @@ use std::fmt::Display; | |||
155 | check_assist_not_applicable( | 155 | check_assist_not_applicable( |
156 | merge_imports, | 156 | merge_imports, |
157 | r" | 157 | r" |
158 | use std::fmt<|>::Debug; | 158 | use std::fmt$0::Debug; |
159 | pub use std::fmt::Display; | 159 | pub use std::fmt::Display; |
160 | ", | 160 | ", |
161 | ); | 161 | ); |
@@ -166,7 +166,7 @@ pub use std::fmt::Display; | |||
166 | check_assist_not_applicable( | 166 | check_assist_not_applicable( |
167 | merge_imports, | 167 | merge_imports, |
168 | r" | 168 | r" |
169 | pub(crate) use std::fmt<|>::Debug; | 169 | pub(crate) use std::fmt$0::Debug; |
170 | pub use std::fmt::Display; | 170 | pub use std::fmt::Display; |
171 | ", | 171 | ", |
172 | ); | 172 | ); |
@@ -177,7 +177,7 @@ pub use std::fmt::Display; | |||
177 | check_assist_not_applicable( | 177 | check_assist_not_applicable( |
178 | merge_imports, | 178 | merge_imports, |
179 | r" | 179 | r" |
180 | pub use std::fmt<|>::Debug; | 180 | pub use std::fmt$0::Debug; |
181 | pub(crate) use std::fmt::Display; | 181 | pub(crate) use std::fmt::Display; |
182 | ", | 182 | ", |
183 | ); | 183 | ); |
@@ -188,7 +188,7 @@ pub(crate) use std::fmt::Display; | |||
188 | check_assist( | 188 | check_assist( |
189 | merge_imports, | 189 | merge_imports, |
190 | r" | 190 | r" |
191 | pub use std::fmt<|>::Debug; | 191 | pub use std::fmt$0::Debug; |
192 | pub use std::fmt::Display; | 192 | pub use std::fmt::Display; |
193 | ", | 193 | ", |
194 | r" | 194 | r" |
@@ -202,7 +202,7 @@ pub use std::fmt::{Debug, Display}; | |||
202 | check_assist( | 202 | check_assist( |
203 | merge_imports, | 203 | merge_imports, |
204 | r" | 204 | r" |
205 | pub(crate) use std::fmt<|>::Debug; | 205 | pub(crate) use std::fmt$0::Debug; |
206 | pub(crate) use std::fmt::Display; | 206 | pub(crate) use std::fmt::Display; |
207 | ", | 207 | ", |
208 | r" | 208 | r" |
@@ -216,7 +216,7 @@ pub(crate) use std::fmt::{Debug, Display}; | |||
216 | check_assist( | 216 | check_assist( |
217 | merge_imports, | 217 | merge_imports, |
218 | r" | 218 | r" |
219 | use std::{fmt<|>::Debug, fmt::Display}; | 219 | use std::{fmt$0::Debug, fmt::Display}; |
220 | ", | 220 | ", |
221 | r" | 221 | r" |
222 | use std::{fmt::{Debug, Display}}; | 222 | use std::{fmt::{Debug, Display}}; |
@@ -229,7 +229,7 @@ use std::{fmt::{Debug, Display}}; | |||
229 | check_assist( | 229 | check_assist( |
230 | merge_imports, | 230 | merge_imports, |
231 | r" | 231 | r" |
232 | use std::{fmt::Debug, fmt<|>::Display}; | 232 | use std::{fmt::Debug, fmt$0::Display}; |
233 | ", | 233 | ", |
234 | r" | 234 | r" |
235 | use std::{fmt::{Debug, Display}}; | 235 | use std::{fmt::{Debug, Display}}; |
@@ -242,7 +242,7 @@ use std::{fmt::{Debug, Display}}; | |||
242 | check_assist( | 242 | check_assist( |
243 | merge_imports, | 243 | merge_imports, |
244 | r" | 244 | r" |
245 | use std<|>::cell::*; | 245 | use std$0::cell::*; |
246 | use std::str; | 246 | use std::str; |
247 | ", | 247 | ", |
248 | r" | 248 | r" |
@@ -256,7 +256,7 @@ use std::{cell::*, str}; | |||
256 | check_assist( | 256 | check_assist( |
257 | merge_imports, | 257 | merge_imports, |
258 | r" | 258 | r" |
259 | use std<|>::cell::*; | 259 | use std$0::cell::*; |
260 | use std::str::*; | 260 | use std::str::*; |
261 | ", | 261 | ", |
262 | r" | 262 | r" |
@@ -270,7 +270,7 @@ use std::{cell::*, str::*}; | |||
270 | check_assist( | 270 | check_assist( |
271 | merge_imports, | 271 | merge_imports, |
272 | r" | 272 | r" |
273 | use foo<|>::bar; | 273 | use foo$0::bar; |
274 | use foo::baz; | 274 | use foo::baz; |
275 | 275 | ||
276 | /// Doc comment | 276 | /// Doc comment |
@@ -289,7 +289,7 @@ use foo::{bar, baz}; | |||
289 | merge_imports, | 289 | merge_imports, |
290 | r" | 290 | r" |
291 | use { | 291 | use { |
292 | foo<|>::bar, | 292 | foo$0::bar, |
293 | foo::baz, | 293 | foo::baz, |
294 | }; | 294 | }; |
295 | ", | 295 | ", |
@@ -304,7 +304,7 @@ use { | |||
304 | r" | 304 | r" |
305 | use { | 305 | use { |
306 | foo::baz, | 306 | foo::baz, |
307 | foo<|>::bar, | 307 | foo$0::bar, |
308 | }; | 308 | }; |
309 | ", | 309 | ", |
310 | r" | 310 | r" |
@@ -321,7 +321,7 @@ use { | |||
321 | merge_imports, | 321 | merge_imports, |
322 | r" | 322 | r" |
323 | use foo::bar::baz; | 323 | use foo::bar::baz; |
324 | use foo::<|>{ | 324 | use foo::$0{ |
325 | FooBar, | 325 | FooBar, |
326 | }; | 326 | }; |
327 | ", | 327 | ", |
@@ -336,7 +336,7 @@ use foo::{FooBar, bar::baz}; | |||
336 | check_assist_not_applicable( | 336 | check_assist_not_applicable( |
337 | merge_imports, | 337 | merge_imports, |
338 | r" | 338 | r" |
339 | use std::<|> | 339 | use std::$0 |
340 | fn main() {}", | 340 | fn main() {}", |
341 | ); | 341 | ); |
342 | } | 342 | } |