Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuple type arguments aren't left as multiline #816

Open
Niols opened this issue Dec 29, 2024 · 0 comments
Open

Tuple type arguments aren't left as multiline #816

Niols opened this issue Dec 29, 2024 · 0 comments
Labels
language: ocaml OCaml formatting issues P3 minor: not priorized type: bug

Comments

@Niols
Copy link
Member

Niols commented Dec 29, 2024

As of f35eee4, Topiary formats:

type t =
  (
    int,
    float,
    string
  ) foo

as:

type t =
  (int, float, string) foo

The multi-line-ness of the type arguments is completely forgotten. When the type arguments are big, this can make for a nasty surprise, eg.

image

I'm not super happy with my snippet, so that might not be how things should look. But at least they shouldn't look as Topiary makes them look now!

To reproduce:

$ nix run github:tweag/topiary/f35eee4 -- format -l ocaml <<EOF
type t =
  (
    int,
    float,
    string
  ) foo
EOF
@Niols Niols added P3 minor: not priorized type: bug language: ocaml OCaml formatting issues labels Dec 29, 2024
@Niols Niols changed the title Type arguments aren't left as multiline. Tuple type arguments aren't left as multiline Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language: ocaml OCaml formatting issues P3 minor: not priorized type: bug
Projects
None yet
Development

No branches or pull requests

1 participant