You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructing a record, if there are comments at the end of a given line but the length of the whole record isn't beyond margin, then the indentation will be very weird.
typevery_long_type = { first : int;second : int;third : int }
letcreate() : very_long_type =
{ first =1; (* first *)
second =1; (* second *)
third =1(* third *) }
If you manually join the lines together, then you get a 75 characters long line (under the margin of 80 characters):
letcreate() : very_long_type =
{ first =1; (* first *) second =1; (* second *) third =1(* third *) }
However, formatting the file from the first or second example produces:
letcreate() : very_long_type =
{ first =1; (* first *)
second =1; (* second *)
third =1(* third *) }
Compare this to when a comment is long enough to push it past the margin:
letcreate() : very_long_type =
{
first =1;
(* a very very very very very long comment *)
second =1;
(* second *)
third =1(* third *);
}
Expected result
Either put it all on one line or split it up like it's too long.
How to Reproduce
Steps to reproduce the behavior:
Open a new ocaml file, add the first snippet to it, run ocamlformat over it.
Describe the bug
When constructing a record, if there are comments at the end of a given line but the length of the whole record isn't beyond
margin
, then the indentation will be very weird.If you manually join the lines together, then you get a 75 characters long line (under the margin of 80 characters):
However, formatting the file from the first or second example produces:
Compare this to when a comment is long enough to push it past the margin:
Expected result
Either put it all on one line or split it up like it's too long.
How to Reproduce
Steps to reproduce the behavior:
Config
Results from
ocamlformat --print-config
The text was updated successfully, but these errors were encountered: