Skip to content

Bug: exp-grouping=preserve doesn't affect else blocks #965

@Wilfred

Description

@Wilfred
let add_watch env path =
  if SSet.mem path env.wpaths
  then None
  else begin
    env.wpaths <- SSet.add path env.wpaths;
    Some path
  end

Formatting produces:

$ ocamlformat --enable-outside-detected-project --exp-grouping=preserve /tmp/foo.ml
let add_watch env path =
  if SSet.mem path env.wpaths then None
  else (
    env.wpaths <- SSet.add path env.wpaths ;
    Some path )

I expected the begin and end to be preserved here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions