AL icon indicating copy to clipboard operation
AL copied to clipboard

[Ctrl+K Ctrl+F] Format Selection does not format **case** command correctly.

Open DavidRoys opened this issue 8 years ago • 3 comments

The following code:

    case CurrentPeriod of
        1 : Period1IsVisible := true;
        2 : Period2IsVisible := true;
        3 : Period3IsVisible := true;
        4 : Period4IsVisible := true;
        5 : Period5IsVisible := true;
        6 : Period6IsVisible := true;
        7 : Period7IsVisible := true;
        8 : Period8IsVisible := true;
        9 : Period9IsVisible := true;
        10 : Period10IsVisible := true;
        11 : Period11IsVisible := true;
        12 : Period12IsVisible := true;
    end;

Gets reformatted to:

    case CurrentPeriod of
        1 : Period1IsVisible := true;

2 : Period2IsVisible := true; 3 : Period3IsVisible := true; 4 : Period4IsVisible := true; 5 : Period5IsVisible := true; 6 : Period6IsVisible := true; 7 : Period7IsVisible := true; 8 : Period8IsVisible := true; 9 : Period9IsVisible := true; 10 : Period10IsVisible := true; 11 : Period11IsVisible := true; 12 : Period12IsVisible := true; end;

DavidRoys avatar Dec 13 '17 01:12 DavidRoys

The formatter has been fixed on case statements, when applied on your code, it will return

 case CurrentPeriod of
            1 :
                Period1IsVisible := true;
            2 :
                Period2IsVisible := true;

            [etc]
 end;

qutreson avatar Dec 13 '17 08:12 qutreson

When you say “has been fixed” do you mean in an upcoming release?

DavidRoys avatar Dec 13 '17 08:12 DavidRoys

The fix will be in the January update

qutreson avatar Dec 13 '17 08:12 qutreson