ocamlformat icon indicating copy to clipboard operation
ocamlformat copied to clipboard

Style: break-separators=after-and-docked doesn't affect tuples

Open hongchangwu opened this issue 6 years ago • 0 comments

First thanks for the continued improvement of ocamlformat.

Describe the bug break-separators=after-and-docked should apply to all bracketed expressions/patterns (i.e. records/lists/arrays/tuples). https://github.com/ocaml-ppx/ocamlformat/pull/931 fixed it for lists/arrays, however tuples are still not affected.

How to Reproduce

Currently ocamlformat produces:

[@@@ocamlformat "break-separators=after-and-docked"]

let x =
  ( "foofoofoofoofoofoofoofoofoofoo",
    "barbarbarbarbarbarbarbarbarbar",
    "foobarfoobarfoobarfoobarfoobar" )

I would expect something like

[@@@ocamlformat "break-separators=after-and-docked"]

let x =
  (
    "foofoofoofoofoofoofoofoofoofoo",
    "barbarbarbarbarbarbarbarbarbar",
    "foobarfoobarfoobarfoobarfoobar"
  )

or

[@@@ocamlformat "break-separators=after-and-docked"]

let x = (
  "foofoofoofoofoofoofoofoofoofoo",
  "barbarbarbarbarbarbarbarbarbar",
  "foobarfoobarfoobarfoobarfoobar"
)

hongchangwu avatar Sep 10 '19 00:09 hongchangwu