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

Leading block comment makes type multiline #1718

Closed
3 tasks
nojaf opened this issue May 11, 2021 · 0 comments · Fixed by #1720
Closed
3 tasks

Leading block comment makes type multiline #1718

nojaf opened this issue May 11, 2021 · 0 comments · Fixed by #1720

Comments

@nojaf
Copy link
Contributor

nojaf commented May 11, 2021

Issue created from fantomas-online

Code

(*
    My personal favorite: Discriminated Unions!
    This is a feature related to sum types in category theory and incredibly useful for code correctness.
    ref: https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/discriminated-unions
*)

type Days = Days of int // you can alias types in F# to get a DDD kind of vibe.
type StoryPoints = StoryPoints of int
type Money = Money of double

Result

(*
    My personal favorite: Discriminated Unions!
    This is a feature related to sum types in category theory and incredibly useful for code correctness.
    ref: https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/discriminated-unions
*)

type Days = Days of int // you can alias types in F# to get a DDD kind of vibe.

type StoryPoints = StoryPoints of int
type Money = Money of double

Problem description

There should not be a blank line after the first type.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 05/09/2021 13:45:10 - f10b822

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

nojaf added a commit that referenced this issue May 11, 2021
* Add WriteLineBecauseOfTrivia for trivia newlines. Fixes #1718.

* Add additional test to cover other multiline directive trivia.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant