Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Printing pipe eats attributes. #621

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/res_printer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3658,6 +3658,7 @@ and printBinaryExpression ~customLayout (expr : Parsetree.expression) cmtTbl =
Doc.group
(Doc.concat
[
printAttributes ~customLayout expr.pexp_attributes cmtTbl;
lhsDoc;
(match (lhsHasCommentBelow, op) with
| true, "|." -> Doc.concat [Doc.softLine; Doc.text "->"]
Expand Down
2 changes: 2 additions & 0 deletions tests/printer/expr/expected/pipe.res.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let ok = @foo optionMap(name, x => x)
let bad = @foo name->optionMap(x => x)
2 changes: 2 additions & 0 deletions tests/printer/expr/pipe.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let ok = @foo (optionMap(name, x => x))
let bad = @foo (name->optionMap(x => x))