Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivia not restored after long identifier in SynField #2290

Merged
merged 3 commits into from
Jun 7, 2022
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 @@ -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

Expand Down
19 changes: 19 additions & 0 deletions src/Fantomas.Core.Tests/UnionTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,25 @@ type Foo = // comment
1
"""

[<Test>]
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
"""

[<Test>]
let ``comment after equals in union`` () =
formatSourceString
Expand Down