@@ -106,6 +106,10 @@ pub(crate) fn move_arm_cond_to_match_guard(acc: &mut Assists, ctx: &AssistContex
106
106
None
107
107
}
108
108
} ) ?;
109
+ if ctx. offset ( ) > if_expr. then_branch ( ) ?. syntax ( ) . text_range ( ) . start ( ) {
110
+ return None ;
111
+ }
112
+
109
113
let replace_node = replace_node. unwrap_or_else ( || if_expr. syntax ( ) . clone ( ) ) ;
110
114
let needs_dedent = replace_node != * if_expr. syntax ( ) ;
111
115
let ( conds_blocks, tail) = parse_if_chain ( if_expr) ?;
@@ -323,7 +327,7 @@ fn main() {
323
327
r#"
324
328
fn main() {
325
329
match 92 {
326
- x => if x > 10 { $0false },
330
+ x => if x > 10$0 { false },
327
331
_ => true
328
332
}
329
333
}
@@ -457,7 +461,7 @@ fn main() {
457
461
r#"
458
462
fn main() {
459
463
match 92 {
460
- x => if let 62 = x && true { $0false },
464
+ x => if let 62 = x $0 && true { false },
461
465
_ => true
462
466
}
463
467
}
@@ -480,7 +484,7 @@ fn main() {
480
484
r#"
481
485
fn main() {
482
486
match 92 {
483
- x => if x > 10 { $0 },
487
+ x => if x $0 > 10 { },
484
488
_ => true
485
489
}
486
490
}
@@ -503,8 +507,8 @@ fn main() {
503
507
r#"
504
508
fn main() {
505
509
match 92 {
506
- x => if x > 10 {
507
- 92;$0
510
+ x => if$0 x > 10 {
511
+ 92;
508
512
false
509
513
},
510
514
_ => true
@@ -533,8 +537,8 @@ fn main() {
533
537
fn main() {
534
538
match 92 {
535
539
x => {
536
- if x > 10 {
537
- 92;$0
540
+ if x > $010 {
541
+ 92;
538
542
false
539
543
}
540
544
}
@@ -563,7 +567,7 @@ fn main() {
563
567
r#"
564
568
fn main() {
565
569
match 92 {
566
- x => if x > 10 {$0
570
+ x => if x > $010 {
567
571
false
568
572
} else {
569
573
true
@@ -593,7 +597,7 @@ fn main() {
593
597
fn main() {
594
598
match 92 {
595
599
x => {
596
- if x > 10 {$0
600
+ if x $0 > 10 {
597
601
false
598
602
} else {
599
603
true
@@ -622,7 +626,7 @@ fn main() {
622
626
r#"
623
627
fn main() {
624
628
match 92 {
625
- x => if x > 10 { $0 } else { },
629
+ x => if x > $010 { } else { },
626
630
_ => true
627
631
}
628
632
}
@@ -646,8 +650,8 @@ fn main() {
646
650
r#"
647
651
fn main() {
648
652
match 92 {
649
- x => if x > 10 {
650
- 92;$0
653
+ x => if$0 x > 10 {
654
+ 92;
651
655
false
652
656
} else {
653
657
true
@@ -679,7 +683,7 @@ fn main() {
679
683
r#"
680
684
fn main() {
681
685
match 92 {
682
- x => if x > 10 {$0
686
+ x => if x $0 > 10 {
683
687
false
684
688
} else {
685
689
42;
@@ -713,7 +717,7 @@ fn main() {
713
717
fn main() {
714
718
match 92 {
715
719
x => {
716
- if x > 10 {$0
720
+ if x > $010 {
717
721
false
718
722
} else {
719
723
42;
@@ -748,7 +752,7 @@ fn main() {
748
752
match 92 {
749
753
3 => true,
750
754
x => {
751
- if x > 10 {$0
755
+ if x > $010 {
752
756
false
753
757
} else {
754
758
92;
@@ -781,7 +785,7 @@ fn main() {
781
785
fn main() {
782
786
match 92 {
783
787
3 => true,
784
- x => if x > 10 {$0
788
+ x => if x > $010 {
785
789
false
786
790
} else {
787
791
92;
@@ -813,7 +817,7 @@ fn main() {
813
817
fn main() {
814
818
match 92 {
815
819
3 => true,
816
- x => if x > 10 {$0
820
+ x => if x $0 > 10 {
817
821
false
818
822
} else if x > 5 {
819
823
true
@@ -849,7 +853,7 @@ fn main() {
849
853
match 92 {
850
854
3 => true,
851
855
x => {
852
- if x > 10 {$0
856
+ if x > $010 {
853
857
false
854
858
} else if x > 5 {
855
859
true
@@ -885,7 +889,7 @@ fn main() {
885
889
fn main() {
886
890
match 92 {
887
891
3 => 0,
888
- x => if x > 10 {$0
892
+ x => if x $0 > 10 {
889
893
1
890
894
} else if x > 5 {
891
895
2
@@ -923,7 +927,7 @@ fn main() {
923
927
fn main() {
924
928
match 92 {
925
929
3 => 0,
926
- x => if x > 10 {$0
930
+ x => if x $0 > 10 {
927
931
1
928
932
} else if x > 5 {
929
933
2
@@ -960,7 +964,7 @@ fn main() {
960
964
fn main() {
961
965
match 92 {
962
966
3 => 0,
963
- x => if x > 10 {$0
967
+ x => if x > $010 {
964
968
1
965
969
} else if x > 5 {
966
970
2
0 commit comments