File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ 5.2.2] - 2023-02-18
4+
5+ ### Fixed
6+ * Fixes comma breaking with lambda in tuple. [ #2771 ] ( https://github.com/fsprojects/fantomas/issues/2771 )
7+
38## [ 5.2.1] - 2023-02-04
49
510### Fixed
Original file line number Diff line number Diff line change @@ -397,3 +397,26 @@ let f x =
397397
398398 ()
399399"""
400+
401+ [<Test>]
402+ let ``comma should not break with lambda as tuple , 2771`` () =
403+ formatSourceString
404+ false
405+ """
406+ let shiftTimes localDate (start: Utc, duration) =
407+ ZonedDate.create TimeZone.current localDate
408+ |> Time.ZonedDate.startOf
409+ |> fun dayStart -> start + dayStart.Duration - refDay.StartTime.Duration
410+ , duration
411+ """
412+ config
413+ |> prepend newline
414+ |> should
415+ equal
416+ """
417+ let shiftTimes localDate (start: Utc, duration) =
418+ ZonedDate.create TimeZone.current localDate
419+ |> Time.ZonedDate.startOf
420+ |> fun dayStart -> start + dayStart.Duration - refDay.StartTime.Duration
421+ , duration
422+ """
Original file line number Diff line number Diff line change @@ -1754,6 +1754,10 @@ let genTupleMultiline (node: ExprTupleNode) =
17541754 match node.RightHandSide with
17551755 | Expr.Lambda _ -> true
17561756 | _ -> false
1757+ | Expr.SameInfixApps node ->
1758+ match List.last node.SubsequentExpressions with
1759+ | _, Expr.Lambda _ -> true
1760+ | _ -> false
17571761 | _ -> false
17581762 | _ -> false )
17591763
You can’t perform that action at this time.
0 commit comments