diff options
author | Lukas Wirth <[email protected]> | 2020-09-12 18:18:14 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-09-12 18:19:19 +0100 |
commit | a898752881779a328462ad9f2db291073f2f134f (patch) | |
tree | 4b6894416bf4f2a875b5bd4a3bc20510a00821d5 /crates/assists/src/handlers/replace_qualified_name_with_use.rs | |
parent | c8623461a57e7882ac47b5da13a1a03efa58f603 (diff) |
Reimplement import merging by making it recursive properly nesting all levels
Diffstat (limited to 'crates/assists/src/handlers/replace_qualified_name_with_use.rs')
-rw-r--r-- | crates/assists/src/handlers/replace_qualified_name_with_use.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/crates/assists/src/handlers/replace_qualified_name_with_use.rs b/crates/assists/src/handlers/replace_qualified_name_with_use.rs index 85c70d16b..093c3b101 100644 --- a/crates/assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/assists/src/handlers/replace_qualified_name_with_use.rs | |||
@@ -312,7 +312,7 @@ impl std::fmt<|> for Foo { | |||
312 | } | 312 | } |
313 | ", | 313 | ", |
314 | r" | 314 | r" |
315 | use std::fmt::{Debug, self}; | 315 | use std::fmt::{self, Debug}; |
316 | 316 | ||
317 | impl fmt for Foo { | 317 | impl fmt for Foo { |
318 | } | 318 | } |
@@ -330,9 +330,8 @@ use std::fmt::{Debug, nested::{Display}}; | |||
330 | impl std::fmt::nested<|> for Foo { | 330 | impl std::fmt::nested<|> for Foo { |
331 | } | 331 | } |
332 | ", | 332 | ", |
333 | // FIXME(veykril): should be nested::{self, Display} here | ||
334 | r" | 333 | r" |
335 | use std::fmt::{Debug, nested::{Display}, nested}; | 334 | use std::fmt::{Debug, nested::{self, Display}}; |
336 | 335 | ||
337 | impl nested for Foo { | 336 | impl nested for Foo { |
338 | } | 337 | } |
@@ -350,9 +349,8 @@ use std::fmt::{Debug, nested::{self, Display}}; | |||
350 | impl std::fmt::nested<|> for Foo { | 349 | impl std::fmt::nested<|> for Foo { |
351 | } | 350 | } |
352 | ", | 351 | ", |
353 | // FIXME(veykril): nested is duplicated now | ||
354 | r" | 352 | r" |
355 | use std::fmt::{Debug, nested::{self, Display}, nested}; | 353 | use std::fmt::{Debug, nested::{self, Display}}; |
356 | 354 | ||
357 | impl nested for Foo { | 355 | impl nested for Foo { |
358 | } | 356 | } |
@@ -371,7 +369,7 @@ impl std::fmt::nested::Debug<|> for Foo { | |||
371 | } | 369 | } |
372 | ", | 370 | ", |
373 | r" | 371 | r" |
374 | use std::fmt::{Debug, nested::{Display}, nested::Debug}; | 372 | use std::fmt::{Debug, nested::{Debug, Display}}; |
375 | 373 | ||
376 | impl Debug for Foo { | 374 | impl Debug for Foo { |
377 | } | 375 | } |
@@ -409,7 +407,7 @@ impl std::fmt::Display<|> for Foo { | |||
409 | } | 407 | } |
410 | ", | 408 | ", |
411 | r" | 409 | r" |
412 | use std::fmt::{nested::Debug, Display}; | 410 | use std::fmt::{Display, nested::Debug}; |
413 | 411 | ||
414 | impl Display for Foo { | 412 | impl Display for Foo { |
415 | } | 413 | } |
@@ -429,12 +427,8 @@ use crate::{ | |||
429 | 427 | ||
430 | fn foo() { crate::ty::lower<|>::trait_env() } | 428 | fn foo() { crate::ty::lower<|>::trait_env() } |
431 | ", | 429 | ", |
432 | // FIXME(veykril): formatting broke here | ||
433 | r" | 430 | r" |
434 | use crate::{ | 431 | use crate::{AssocItem, ty::{Substs, Ty, lower}}; |
435 | ty::{Substs, Ty}, | ||
436 | AssocItem, | ||
437 | ty::lower}; | ||
438 | 432 | ||
439 | fn foo() { lower::trait_env() } | 433 | fn foo() { lower::trait_env() } |
440 | ", | 434 | ", |
@@ -633,7 +627,7 @@ fn main() { | |||
633 | } | 627 | } |
634 | ", | 628 | ", |
635 | r" | 629 | r" |
636 | use std::fmt::{Display, self}; | 630 | use std::fmt::{self, Display}; |
637 | 631 | ||
638 | fn main() { | 632 | fn main() { |
639 | fmt; | 633 | fmt; |