diff options
-rw-r--r-- | crates/assists/src/handlers/unwrap_block.rs | 540 |
1 files changed, 270 insertions, 270 deletions
diff --git a/crates/assists/src/handlers/unwrap_block.rs b/crates/assists/src/handlers/unwrap_block.rs index 496714243..676db7137 100644 --- a/crates/assists/src/handlers/unwrap_block.rs +++ b/crates/assists/src/handlers/unwrap_block.rs | |||
@@ -181,27 +181,27 @@ fn main() { | |||
181 | check_assist( | 181 | check_assist( |
182 | unwrap_block, | 182 | unwrap_block, |
183 | r#" | 183 | r#" |
184 | fn main() { | 184 | fn main() { |
185 | bar(); | 185 | bar(); |
186 | if true {<|> | 186 | if true {<|> |
187 | foo(); | 187 | foo(); |
188 | 188 | ||
189 | //comment | 189 | //comment |
190 | bar(); | 190 | bar(); |
191 | } else { | 191 | } else { |
192 | println!("bar"); | 192 | println!("bar"); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | "#, | 195 | "#, |
196 | r#" | 196 | r#" |
197 | fn main() { | 197 | fn main() { |
198 | bar(); | 198 | bar(); |
199 | foo(); | 199 | foo(); |
200 | 200 | ||
201 | //comment | 201 | //comment |
202 | bar(); | 202 | bar(); |
203 | } | 203 | } |
204 | "#, | 204 | "#, |
205 | ); | 205 | ); |
206 | } | 206 | } |
207 | 207 | ||
@@ -210,30 +210,30 @@ fn main() { | |||
210 | check_assist( | 210 | check_assist( |
211 | unwrap_block, | 211 | unwrap_block, |
212 | r#" | 212 | r#" |
213 | fn main() { | 213 | fn main() { |
214 | bar(); | 214 | bar(); |
215 | if true { | 215 | if true { |
216 | foo(); | 216 | foo(); |
217 | 217 | ||
218 | //comment | 218 | //comment |
219 | bar(); | 219 | bar(); |
220 | } else {<|> | 220 | } else {<|> |
221 | println!("bar"); | 221 | println!("bar"); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | "#, | 224 | "#, |
225 | r#" | 225 | r#" |
226 | fn main() { | 226 | fn main() { |
227 | bar(); | 227 | bar(); |
228 | if true { | 228 | if true { |
229 | foo(); | 229 | foo(); |
230 | 230 | ||
231 | //comment | 231 | //comment |
232 | bar(); | 232 | bar(); |
233 | } | 233 | } |
234 | println!("bar"); | 234 | println!("bar"); |
235 | } | 235 | } |
236 | "#, | 236 | "#, |
237 | ); | 237 | ); |
238 | } | 238 | } |
239 | 239 | ||
@@ -242,32 +242,32 @@ fn main() { | |||
242 | check_assist( | 242 | check_assist( |
243 | unwrap_block, | 243 | unwrap_block, |
244 | r#" | 244 | r#" |
245 | fn main() { | 245 | fn main() { |
246 | //bar(); | 246 | //bar(); |
247 | if true { | 247 | if true { |
248 | println!("true"); | 248 | println!("true"); |
249 | 249 | ||
250 | //comment | 250 | //comment |
251 | //bar(); | 251 | //bar(); |
252 | } else if false {<|> | 252 | } else if false {<|> |
253 | println!("bar"); | 253 | println!("bar"); |
254 | } else { | 254 | } else { |
255 | println!("foo"); | 255 | println!("foo"); |
256 | } | 256 | } |
257 | } | 257 | } |
258 | "#, | 258 | "#, |
259 | r#" | 259 | r#" |
260 | fn main() { | 260 | fn main() { |
261 | //bar(); | 261 | //bar(); |
262 | if true { | 262 | if true { |
263 | println!("true"); | 263 | println!("true"); |
264 | 264 | ||
265 | //comment | 265 | //comment |
266 | //bar(); | 266 | //bar(); |
267 | } | 267 | } |
268 | println!("bar"); | 268 | println!("bar"); |
269 | } | 269 | } |
270 | "#, | 270 | "#, |
271 | ); | 271 | ); |
272 | } | 272 | } |
273 | 273 | ||
@@ -276,34 +276,34 @@ fn main() { | |||
276 | check_assist( | 276 | check_assist( |
277 | unwrap_block, | 277 | unwrap_block, |
278 | r#" | 278 | r#" |
279 | fn main() { | 279 | fn main() { |
280 | //bar(); | 280 | //bar(); |
281 | if true { | 281 | if true { |
282 | println!("true"); | 282 | println!("true"); |
283 | 283 | ||
284 | //comment | 284 | //comment |
285 | //bar(); | 285 | //bar(); |
286 | } else if false { | 286 | } else if false { |
287 | println!("bar"); | 287 | println!("bar"); |
288 | } else if true {<|> | 288 | } else if true {<|> |
289 | println!("foo"); | 289 | println!("foo"); |
290 | } | 290 | } |
291 | } | 291 | } |
292 | "#, | 292 | "#, |
293 | r#" | 293 | r#" |
294 | fn main() { | 294 | fn main() { |
295 | //bar(); | 295 | //bar(); |
296 | if true { | 296 | if true { |
297 | println!("true"); | 297 | println!("true"); |
298 | 298 | ||
299 | //comment | 299 | //comment |
300 | //bar(); | 300 | //bar(); |
301 | } else if false { | 301 | } else if false { |
302 | println!("bar"); | 302 | println!("bar"); |
303 | } | 303 | } |
304 | println!("foo"); | 304 | println!("foo"); |
305 | } | 305 | } |
306 | "#, | 306 | "#, |
307 | ); | 307 | ); |
308 | } | 308 | } |
309 | 309 | ||
@@ -312,38 +312,38 @@ fn main() { | |||
312 | check_assist( | 312 | check_assist( |
313 | unwrap_block, | 313 | unwrap_block, |
314 | r#" | 314 | r#" |
315 | fn main() { | 315 | fn main() { |
316 | //bar(); | 316 | //bar(); |
317 | if true { | 317 | if true { |
318 | println!("true"); | 318 | println!("true"); |
319 | 319 | ||
320 | //comment | 320 | //comment |
321 | //bar(); | 321 | //bar(); |
322 | } else if false { | 322 | } else if false { |
323 | println!("bar"); | 323 | println!("bar"); |
324 | } else if true { | 324 | } else if true { |
325 | println!("foo"); | 325 | println!("foo"); |
326 | } else {<|> | 326 | } else {<|> |
327 | println!("else"); | 327 | println!("else"); |
328 | } | 328 | } |
329 | } | 329 | } |
330 | "#, | 330 | "#, |
331 | r#" | 331 | r#" |
332 | fn main() { | 332 | fn main() { |
333 | //bar(); | 333 | //bar(); |
334 | if true { | 334 | if true { |
335 | println!("true"); | 335 | println!("true"); |
336 | 336 | ||
337 | //comment | 337 | //comment |
338 | //bar(); | 338 | //bar(); |
339 | } else if false { | 339 | } else if false { |
340 | println!("bar"); | 340 | println!("bar"); |
341 | } else if true { | 341 | } else if true { |
342 | println!("foo"); | 342 | println!("foo"); |
343 | } | 343 | } |
344 | println!("else"); | 344 | println!("else"); |
345 | } | 345 | } |
346 | "#, | 346 | "#, |
347 | ); | 347 | ); |
348 | } | 348 | } |
349 | 349 | ||
@@ -352,36 +352,36 @@ fn main() { | |||
352 | check_assist( | 352 | check_assist( |
353 | unwrap_block, | 353 | unwrap_block, |
354 | r#" | 354 | r#" |
355 | fn main() { | 355 | fn main() { |
356 | //bar(); | 356 | //bar(); |
357 | if true { | 357 | if true { |
358 | println!("true"); | 358 | println!("true"); |
359 | 359 | ||
360 | //comment | 360 | //comment |
361 | //bar(); | 361 | //bar(); |
362 | } else if false { | 362 | } else if false { |
363 | println!("bar"); | 363 | println!("bar"); |
364 | } else if true {<|> | 364 | } else if true {<|> |
365 | println!("foo"); | 365 | println!("foo"); |
366 | } else { | 366 | } else { |
367 | println!("else"); | 367 | println!("else"); |
368 | } | 368 | } |
369 | } | 369 | } |
370 | "#, | 370 | "#, |
371 | r#" | 371 | r#" |
372 | fn main() { | 372 | fn main() { |
373 | //bar(); | 373 | //bar(); |
374 | if true { | 374 | if true { |
375 | println!("true"); | 375 | println!("true"); |
376 | 376 | ||
377 | //comment | 377 | //comment |
378 | //bar(); | 378 | //bar(); |
379 | } else if false { | 379 | } else if false { |
380 | println!("bar"); | 380 | println!("bar"); |
381 | } | 381 | } |
382 | println!("foo"); | 382 | println!("foo"); |
383 | } | 383 | } |
384 | "#, | 384 | "#, |
385 | ); | 385 | ); |
386 | } | 386 | } |
387 | 387 | ||
@@ -390,18 +390,18 @@ fn main() { | |||
390 | check_assist_not_applicable( | 390 | check_assist_not_applicable( |
391 | unwrap_block, | 391 | unwrap_block, |
392 | r#" | 392 | r#" |
393 | fn main() { | 393 | fn main() { |
394 | bar();<|> | 394 | bar();<|> |
395 | if true { | 395 | if true { |
396 | foo(); | 396 | foo(); |
397 | 397 | ||
398 | //comment | 398 | //comment |
399 | bar(); | 399 | bar(); |
400 | } else { | 400 | } else { |
401 | println!("bar"); | 401 | println!("bar"); |
402 | } | 402 | } |
403 | } | 403 | } |
404 | "#, | 404 | "#, |
405 | ); | 405 | ); |
406 | } | 406 | } |
407 | 407 | ||
@@ -410,31 +410,31 @@ fn main() { | |||
410 | check_assist( | 410 | check_assist( |
411 | unwrap_block, | 411 | unwrap_block, |
412 | r#" | 412 | r#" |
413 | fn main() { | 413 | fn main() { |
414 | for i in 0..5 {<|> | 414 | for i in 0..5 {<|> |
415 | if true { | 415 | if true { |
416 | foo(); | 416 | foo(); |
417 | 417 | ||
418 | //comment | 418 | //comment |
419 | bar(); | 419 | bar(); |
420 | } else { | 420 | } else { |
421 | println!("bar"); | 421 | println!("bar"); |
422 | } | 422 | } |
423 | } | 423 | } |
424 | } | 424 | } |
425 | "#, | 425 | "#, |
426 | r#" | 426 | r#" |
427 | fn main() { | 427 | fn main() { |
428 | if true { | 428 | if true { |
429 | foo(); | 429 | foo(); |
430 | 430 | ||
431 | //comment | 431 | //comment |
432 | bar(); | 432 | bar(); |
433 | } else { | 433 | } else { |
434 | println!("bar"); | 434 | println!("bar"); |
435 | } | 435 | } |
436 | } | 436 | } |
437 | "#, | 437 | "#, |
438 | ); | 438 | ); |
439 | } | 439 | } |
440 | 440 | ||
@@ -443,29 +443,29 @@ fn main() { | |||
443 | check_assist( | 443 | check_assist( |
444 | unwrap_block, | 444 | unwrap_block, |
445 | r#" | 445 | r#" |
446 | fn main() { | 446 | fn main() { |
447 | for i in 0..5 { | 447 | for i in 0..5 { |
448 | if true {<|> | 448 | if true {<|> |
449 | foo(); | 449 | foo(); |
450 | 450 | ||
451 | //comment | 451 | //comment |
452 | bar(); | 452 | bar(); |
453 | } else { | 453 | } else { |
454 | println!("bar"); | 454 | println!("bar"); |
455 | } | 455 | } |
456 | } | 456 | } |
457 | } | 457 | } |
458 | "#, | 458 | "#, |
459 | r#" | 459 | r#" |
460 | fn main() { | 460 | fn main() { |
461 | for i in 0..5 { | 461 | for i in 0..5 { |
462 | foo(); | 462 | foo(); |
463 | 463 | ||
464 | //comment | 464 | //comment |
465 | bar(); | 465 | bar(); |
466 | } | 466 | } |
467 | } | 467 | } |
468 | "#, | 468 | "#, |
469 | ); | 469 | ); |
470 | } | 470 | } |
471 | 471 | ||
@@ -474,31 +474,31 @@ fn main() { | |||
474 | check_assist( | 474 | check_assist( |
475 | unwrap_block, | 475 | unwrap_block, |
476 | r#" | 476 | r#" |
477 | fn main() { | 477 | fn main() { |
478 | loop {<|> | 478 | loop {<|> |
479 | if true { | 479 | if true { |
480 | foo(); | 480 | foo(); |
481 | 481 | ||
482 | //comment | 482 | //comment |
483 | bar(); | 483 | bar(); |
484 | } else { | 484 | } else { |
485 | println!("bar"); | 485 | println!("bar"); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | } | 488 | } |
489 | "#, | 489 | "#, |
490 | r#" | 490 | r#" |
491 | fn main() { | 491 | fn main() { |
492 | if true { | 492 | if true { |
493 | foo(); | 493 | foo(); |
494 | 494 | ||
495 | //comment | 495 | //comment |
496 | bar(); | 496 | bar(); |
497 | } else { | 497 | } else { |
498 | println!("bar"); | 498 | println!("bar"); |
499 | } | 499 | } |
500 | } | 500 | } |
501 | "#, | 501 | "#, |
502 | ); | 502 | ); |
503 | } | 503 | } |
504 | 504 | ||
@@ -507,31 +507,31 @@ fn main() { | |||
507 | check_assist( | 507 | check_assist( |
508 | unwrap_block, | 508 | unwrap_block, |
509 | r#" | 509 | r#" |
510 | fn main() { | 510 | fn main() { |
511 | while true {<|> | 511 | while true {<|> |
512 | if true { | 512 | if true { |
513 | foo(); | 513 | foo(); |
514 | 514 | ||
515 | //comment | 515 | //comment |
516 | bar(); | 516 | bar(); |
517 | } else { | 517 | } else { |
518 | println!("bar"); | 518 | println!("bar"); |
519 | } | 519 | } |
520 | } | 520 | } |
521 | } | 521 | } |
522 | "#, | 522 | "#, |
523 | r#" | 523 | r#" |
524 | fn main() { | 524 | fn main() { |
525 | if true { | 525 | if true { |
526 | foo(); | 526 | foo(); |
527 | 527 | ||
528 | //comment | 528 | //comment |
529 | bar(); | 529 | bar(); |
530 | } else { | 530 | } else { |
531 | println!("bar"); | 531 | println!("bar"); |
532 | } | 532 | } |
533 | } | 533 | } |
534 | "#, | 534 | "#, |
535 | ); | 535 | ); |
536 | } | 536 | } |
537 | 537 | ||
@@ -564,19 +564,19 @@ fn main() { | |||
564 | check_assist_not_applicable( | 564 | check_assist_not_applicable( |
565 | unwrap_block, | 565 | unwrap_block, |
566 | r#" | 566 | r#" |
567 | fn main() { | 567 | fn main() { |
568 | while true { | 568 | while true { |
569 | if true { | 569 | if true { |
570 | foo();<|> | 570 | foo();<|> |
571 | 571 | ||
572 | //comment | 572 | //comment |
573 | bar(); | 573 | bar(); |
574 | } else { | 574 | } else { |
575 | println!("bar"); | 575 | println!("bar"); |
576 | } | 576 | } |
577 | } | 577 | } |
578 | } | 578 | } |
579 | "#, | 579 | "#, |
580 | ); | 580 | ); |
581 | } | 581 | } |
582 | } | 582 | } |