File tree Expand file tree Collapse file tree 1 file changed +105
-0
lines changed
crates/ide-assists/src/handlers Expand file tree Collapse file tree 1 file changed +105
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,111 @@ mod b {
609
609
) ;
610
610
}
611
611
612
+ #[ test]
613
+ fn remove_comma_after_auto_remove_brace ( ) {
614
+ check_assist (
615
+ remove_unused_imports,
616
+ r#"
617
+ mod m {
618
+ pub mod x {
619
+ pub struct A;
620
+ pub struct B;
621
+ }
622
+ pub mod y {
623
+ pub struct C;
624
+ }
625
+ }
626
+
627
+ $0use m::{
628
+ x::{A, B},
629
+ y::C,
630
+ };$0
631
+
632
+ fn main() {
633
+ B;
634
+ }
635
+ "# ,
636
+ r#"
637
+ mod m {
638
+ pub mod x {
639
+ pub struct A;
640
+ pub struct B;
641
+ }
642
+ pub mod y {
643
+ pub struct C;
644
+ }
645
+ }
646
+
647
+ use m::
648
+ x::B
649
+ ;
650
+
651
+ fn main() {
652
+ B;
653
+ }
654
+ "# ,
655
+ ) ;
656
+ check_assist (
657
+ remove_unused_imports,
658
+ r#"
659
+ mod m {
660
+ pub mod x {
661
+ pub struct A;
662
+ pub struct B;
663
+ }
664
+ pub mod y {
665
+ pub struct C;
666
+ pub struct D;
667
+ }
668
+ pub mod z {
669
+ pub struct E;
670
+ pub struct F;
671
+ }
672
+ }
673
+
674
+ $0use m::{
675
+ x::{A, B},
676
+ y::{C, D,},
677
+ z::{E, F},
678
+ };$0
679
+
680
+ fn main() {
681
+ B;
682
+ C;
683
+ F;
684
+ }
685
+ "# ,
686
+ r#"
687
+ mod m {
688
+ pub mod x {
689
+ pub struct A;
690
+ pub struct B;
691
+ }
692
+ pub mod y {
693
+ pub struct C;
694
+ pub struct D;
695
+ }
696
+ pub mod z {
697
+ pub struct E;
698
+ pub struct F;
699
+ }
700
+ }
701
+
702
+ use m::{
703
+ x::B,
704
+ y::C,
705
+ z::F,
706
+ };
707
+
708
+ fn main() {
709
+ B;
710
+ C;
711
+ F;
712
+ }
713
+ "# ,
714
+ ) ;
715
+ }
716
+
612
717
#[ test]
613
718
fn remove_nested_all_unused ( ) {
614
719
check_assist (
You can’t perform that action at this time.
0 commit comments