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

Question: Is there a way to wrap records rather than breaking them? #2514

Open
mooreryan opened this issue Jan 22, 2024 · 1 comment
Open

Comments

@mooreryan
Copy link

mooreryan commented Jan 22, 2024

Regarding ocamlformat 0.26.1, there is an option for wrapping collections: break-collection-expressions = wrap.

As far as I can tell there is no analogous option for wrapping records. E.g., this

{ a: string; b: string; c: int; ... go until max column then wrap...
; h: blah; ... go until max column then wrap ...
; z: int }

Always goes to this if it is past the column limit.

{ a: string
; b: string
; c: int
...
; z: int }

Is there an option that I'm missing, and if not, is there a reason that you can wrap collections but not records?

(Sometimes I will put an [@ocamlformat "disable"] tag on the record and format it myself if it is quite long, but I'm wondering if there is an automatic way.)

@gpetiot
Copy link
Collaborator

gpetiot commented Jan 23, 2024

There is no option for that indeed. That's not something I've considered in the past, but it makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants