fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
764 stars 190 forks source link

Shifted Quote #2921

Closed IgorErin closed 1 year ago

IgorErin commented 1 year ago

Issue created from fantomas-online

Code

let unionTests context =
    [ ptestProperty (message "GenericDU<bool, Option<bool>>")
      <| fun (data: GenericDU<bool, Option<bool>>[]) ->

          testProperty (message "GenericRecord<Option<int>, Option<int64>>")
          <| fun (data: GenericRecord<Option<int>, Option<int64>>[]) ->
              if data.Length <> 0 then
                  check data
                  <| fun length ->
                      <@
                          fun (range: Range1D) (buffer: ClArray<_>) ->
                              ()

                      @> ]

Result

let unionTests context =
    [ ptestProperty (message "GenericDU<bool, Option<bool>>")
      <| fun (data: GenericDU<bool, Option<bool>>[]) ->

          testProperty (message "GenericRecord<Option<int>, Option<int64>>")
          <| fun (data: GenericRecord<Option<int>, Option<int64>>[]) ->
              if data.Length <> 0 then
                  check data
                  <| fun length ->
                      <@ fun (range: Range1D) (buffer: ClArray<_>) -> ()

                      @> ]

Problem description

Fantomas himself says that this result requires formatting

Extra information

Options

Fantomas main branch at 1/1/1990

Default Fantomas configuration

Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

nojaf commented 1 year ago

Hello, thank you for showing interest in this project.

The online tool actually formats the code twice and verifies the first formatted result is idempotent. As it is not reporting such a problem, I'm not sure there is a problem here.

Two things might be happening:

Could you verify these things, please?