Skip to content
Merged
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Long `&` (AND) patterns now break across multiple lines to respect max line length. [#1780](https://github.com/fsprojects/fantomas/issues/1780)
- Empty array with trivia inside now has correct indentation in Stroustrup style. [#3098](https://github.com/fsprojects/fantomas/issues/3098)
- Multiline function type inside parentheses gets extra indentation to avoid compiler error. [#3043](https://github.com/fsprojects/fantomas/issues/3043)
- Trivia around paren lambda with conditional compilation no longer causes merge error. [#2844](https://github.com/fsprojects/fantomas/issues/2844)

## [8.0.0-alpha-002] - 2025-12-15

Expand Down
43 changes: 43 additions & 0 deletions src/Fantomas.Core.Tests/CompilerDirectivesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3240,3 +3240,46 @@ let CombineImportedAssembliesTask

()
"""

[<Test>]
let ``trivia around paren lambda with conditional compilation, 2844`` () =
formatSourceString
"""
Program.statefulWithCmdMsg
|> (fun program ->
{ program with
CanReuseView = ViewHelper.canReuseView
SyncAction =
(fun fn ->
program.SyncAction
(
#if IOS
// iOS animates by default layout changes, we don't want that
fun () -> UIKit.UIView.PerformWithoutAnimation(fn)
#else
fn
#endif
)) })
"""
config
|> prepend newline
|> should
equal
"""
Program.statefulWithCmdMsg
|> (fun program ->
{ program with
CanReuseView = ViewHelper.canReuseView
SyncAction =
(fun fn ->
program.SyncAction
(
#if IOS
// iOS animates by default layout changes, we don't want that
fun () -> UIKit.UIView.PerformWithoutAnimation(fn)
#else
fn
#endif
))
})
"""