Skip to content

Comments lost on format #3

@darianmiller

Description

@darianmiller

First - thanks for doing DelphiFmt! 🎉

I had a little time and started a little front-end tonight using your formatting code and quickly ran into a show-stopper. I looked through options and didn't see if this was configurable, but it appears comments are stripped using default settings.

Example:

type

  TDropsComments = record  // all comments will
    AItem: Integer;        //will be lost
    Another: string;       //  after format
  end;

(*
This is also gone
*)

implementation

{ Same here }

procedure Foo; //test
begin
end;

It's interesting that test_unit_complex_unformatted.pas starts with a comment header and it remains in the formatted file but if you add any other comments into the file, they get stripped.

This stays:

{===============================================================================
  DelphiFmt Test File — Deliberately Unformatted
  This file is intentionally malformatted to exercise every formatter rule.
  After formatting, inspect output visually. Format again to verify idempotency.
===============================================================================}

Using latest version 0.1.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions