fantomas icon indicating copy to clipboard operation
fantomas copied to clipboard

Multiple List concat operators are not seen as the same operator.

Open nojaf opened this issue 3 years ago • 1 comments

Issue created from fantomas-online

Code

        let allDecls = inheritsL @ iimplsLs @ ctorLs @ instanceValLs @ methLs @ ilFieldsL @ propLs @ eventLs @ staticValLs @ nestedTypeLs

        let allDecls = inheritsL + iimplsLs + ctorLs + instanceValLs + methLs + ilFieldsL + propLs + eventLs + staticValLs + nestedTypeLs

Result

let allDecls =
    inheritsL
    @ iimplsLs
      @ ctorLs
        @ instanceValLs
          @ methLs @ ilFieldsL @ propLs @ eventLs @ staticValLs @ nestedTypeLs

let allDecls =
    inheritsL
    + iimplsLs
    + ctorLs
    + instanceValLs
    + methLs
    + ilFieldsL
    + propLs
    + eventLs
    + staticValLs
    + nestedTypeLs

Problem description

Fantomas has heurstic that if the operators are all the same in a large nested infix application, it will place them all on a new line. For some reason, this isn't working for @.

Extra information

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

Options

Fantomas master branch at 2022-09-01T05:33:17Z - 582e9ab5dc7d7e041e5f4d1ce203dc40b98d98a7

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 avatar Sep 01 '22 08:09 nojaf

The problem isn't limited to @, sample with ^^

nojaf avatar Sep 01 '22 12:09 nojaf

Fix available in v5.2.0-beta-001

nojaf avatar Jan 02 '23 09:01 nojaf