ocamlformat
ocamlformat copied to clipboard
Feature request: respect indicate-multiline-delimiters in more cases
We have a few examples of parentheses that respect indicate-multiline-delimiters:
(* Respecting indicate-multiline-delimiters *)
;;
match a with
| _ -> (
match b______________________________ with
| _ -> c_____________________________ )
;;
( a______________________________________
$ b______________________________________ )
@ c
but also many that do not. Most of the offenders are parentheses added to attach attributes correctly (I suspect that are a lot of these),
(* Not respecting indicate-multiline-delimiters *)
;;
(f a
[@attr_____________________________________________________________________])
()
;;
a
|> (b__________________________ c________________________
d_______________________ [@attr])
but there are also things such as sugared local opens:
;;
Arg.(
a______________________________________
$ b____________________________________)
This suggests to me that these parentheses should all be handled by a single pretty-printer that respects the config.
Related to https://github.com/ocaml-ppx/ocamlformat/pull/1169, but attributes and local opens have never been right I think.