Menu

#458 Member variables Name and Index are formatted incorrectly

Closed
closed-fixed
formatter (29)
5
2025-11-02
2025-10-17
No

Formatting

type
  TTest = class
    Field: Integer;
    Name, Value: string;
  end;

yields

type
  TTest = class
    Field: Integer;
      name, Value: string;
  end;

for me. The Name member gets lowercased and indented. It's the same for a member Index or Export, so it's probably keywords that are affected.

Discussion

  • Thomas Mueller

    Thomas Mueller - 2025-11-02

    Note to self:

    This would have been detected fine, if it had been "Index" instead of "Name" and if it had been the last identifier before the colon, but unfortunately there is a second field declared with the same type.

    This works fine:

    type
      TTest = class
        Field: Integer;
        Index: string;
        Value: string;
      end;
    

    It's odd that I've never noticed that before. Having a field called "Name" isn't that uncommon.

     
  • Thomas Mueller

    Thomas Mueller - 2025-11-02
    • status: open --> closed-fixed
    • assigned_to: Thomas Mueller
    • Group: New --> Closed
     
  • Thomas Mueller

    Thomas Mueller - 2025-11-02

    fixed in revision #4891

     

Log in to post a comment.