tweag / topiary

https://topiary.tweag.io/
MIT License
575 stars 29 forks source link

`::` ignores single- vs multi-line #658

Open Niols opened 11 months ago

Niols commented 11 months ago

As of https://github.com/tweag/topiary/commit/8cc9aa40d99c89b448190bb1693777128fdcd6c0, Topiary formats:

let () = a :: b
    :: c

as:

let () =
  a :: b :: c

which takes into account the multi-line mode for let but not for ::. I would expect it to be multi-line, eg:

let () =
  a ::
    b ::
    c

or

let () =
  a
    :: b
    :: c

Related to https://github.com/tweag/topiary/issues/657 for uniformity of the handling of operators.

To reproduce:

$ nix run github:tweag/topiary/8cc9aa40d -- format -l ocaml <<EOF
let () = a :: b
    :: c
EOF