Skip to content

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

@hongchangwu

Description

@hongchangwu

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). #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"
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions