ocaml-ppx / ocamlformat

Auto-formatter for OCaml code
MIT License
633 stars 179 forks source link

Simplify representation of class field values and methods #2529

Closed gpetiot closed 8 months ago

gpetiot commented 9 months ago

Makes #2401 easier.

@Julow some normalizations have been undone (see js_source.ml), but the result is closer, and some indentation has to be fixed, but this tremendously simplifies the formatting, and removes the calls to Sugar.fun_ for Pexp_newtype and for fmt_class_field_kind.

If you have the time to have a look at the indentation that would be very helpful!

gpetiot commented 8 months ago

I tried to split the AST change away from the formatting change, but it runs too deep. I tried to minimize the diff as much as I could instead, and I added a changelog entry for the normalizations and for taking into account the break-colon option.