rescript-vscode icon indicating copy to clipboard operation
rescript-vscode copied to clipboard

Formatter: Line break with long single pipe

Open hellos3b opened this issue 10 months ago • 0 comments

When working with a long module name (typically when using Something__Namespaced), if you use a single pipe it will break line at the argument:

let long =
  SomeLongModuleName.make("Lorem Ipsum es simplemente")->SomeLongModuleName.map(
    updateFooToBar,
  )

This is more difficult to read than if it broke line on the pipe:

let long =
  SomeLongModuleName.make("Lorem Ipsum es simplemente")
  ->SomeLongModuleName.map(updateFooToBar)

I would love it if at the very least I can make the decision myself by introducing a newline, similar with how 2+ pipes will auto break or not

hellos3b avatar Feb 01 '25 21:02 hellos3b