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

Feature request: put parens around match inside type annotation #2266

Closed
ceastlund opened this issue Mar 6, 2023 · 0 comments · Fixed by #2289
Closed

Feature request: put parens around match inside type annotation #2266

ceastlund opened this issue Mar 6, 2023 · 0 comments · Fixed by #2289

Comments

@ceastlund
Copy link

ceastlund commented Mar 6, 2023

The following code:

((match foo with | Bar -> bar | Baz -> baz) : string)

Is now formatted like this:

(match foo with
 | Bar -> bar
 | Baz -> baz
  : string)

It used to leave the inner parentheses intact, to clearly associate the type annotation with match instead of baz.

On its own, the new code would probably be fine, as the indentation makes the association pretty clear. However, with our current use of ocp-indent, the : string gets indented flush with baz. So until we're ready to ditch ocp-indent, we'd like to keep the extra parentheses.

Edit: I only checked this with --profile=janestreet, and I'm only requesting the change in that profile.

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