Menu ▾ ▴

#617 Code Formatter: comma-first uses clause gets every comma on a line of its own

Closed
closed-fixed
nobody
None
2 hours ago
6 hours ago
No

With Between every unit in "uses" set and Before the comma not set, a uses clause that is already written with the commas at the start of the lines is not turned into the comma-after layout. The formatter keeps the existing line break before each comma and adds its own after it, so each comma ends up alone on a line.

Input:

uses
  Delta
  , Epsilon
  , Zeta
  ;

Output:

  uses
    Delta
    ,
    Epsilon
    ,
    Zeta
    ;

Expected:

  uses
    Delta,
    Epsilon,
    Zeta;

Settings (Line Breaks and Indent tabs): Between every unit in "uses" = on, Before the comma = off, Do not indent uses starting with , = off, Indent interface/implementation = on, Always break line after "uses" = on. A uses clause with all units on one line ("Alpha, Beta, Gamma;") is formatted correctly with the same settings. Only measured with indented sections on.

Found while implementing [feature-requests:#90].

Related

Feature Requests: #90

Discussion

  • Thomas Mueller

    Thomas Mueller - 2 hours ago

    Fixed in [r6226]: a comma or semicolon that starts a line now moves back behind the unit before it, also past a comment at the end of that line, so the clause gets the comma-after layout.

     

    Related

    Commit: [r6226]


Log in to post a comment.