-
Notifications
You must be signed in to change notification settings - Fork 182
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
Bug: infix operator dropped #2406
Comments
I couldn't fix it but the issue is located in https://github.com/ocaml-ppx/ocamlformat/blob/main/lib/Fmt_ast.ml#L1615-L1623 The way the breaks are added is very flimsy |
The following diff seems to fix the issue. diff --git a/lib/Fmt_ast.ml b/lib/Fmt_ast.ml
index 36d43f5d..d544d3de 100644
--- a/lib/Fmt_ast.ml
+++ b/lib/Fmt_ast.ml
@@ -2361,6 +2361,7 @@ and fmt_expression c ?(box = true) ?pro ?epi ?eol ?parens ?(indent_wrap = 0)
if c.conf.fmt_opts.leading_nested_match_parens.v then (false, None)
else (parenze_exp xpc_rhs, Some false)
in
+ fmt_opt epi $
Params.Exp.wrap c.conf ~parens ~disambiguate:true
(hvbox 2
( hvbox 0 |
Indeed. I went into the rabbit hole of fixing We might want to use |
when using
ocp-indent-compat = true
I see the following invalid rewriting.
taken from ocsigen-start.6.1.0:tools/sort_deps.ml
The text was updated successfully, but these errors were encountered: