diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f33640ea0..4f7a297ba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed * Explicit interface with SpaceBeforeClassConstructor. [#2226](https://github.com/fsprojects/fantomas/issues/2226) * Spaces around binary operators in units of measure. [#2207](https://github.com/fsprojects/fantomas/issues/2207) +* Trivia not restored after long identifier in SynField. [#2290](https://github.com/fsprojects/fantomas/pull/2290) ## [5.0.0-alpha-008] - 2022-05-28 diff --git a/src/Fantomas.Core.Tests/UnionTests.fs b/src/Fantomas.Core.Tests/UnionTests.fs index 79722d0634..07d110ff6f 100644 --- a/src/Fantomas.Core.Tests/UnionTests.fs +++ b/src/Fantomas.Core.Tests/UnionTests.fs @@ -879,6 +879,25 @@ type Foo = // comment 1 """ +[] +let ``trivia not restored after long identifier in SynField, 2103`` () = + formatSourceString + false + """ +type X = + | A of int // This comment survives + | B of C.D // This comment survives +""" + config + |> prepend newline + |> should + equal + """ +type X = + | A of int // This comment survives + | B of C.D // This comment survives +""" + [] let ``comment after equals in union`` () = formatSourceString