fsprojects / fantomas

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

Incorrect indentation when space around delimiter is false #362

Closed nojaf closed 5 years ago

nojaf commented 5 years ago

Description

Before:

let config =
    [ ("number", "12368")
      ("date", "616165")
      ("code: ", "1616155")
      ("order reference", "561616") ]

The space between [ and ( is removed after formatting but the other lines are formatted one space too far. This happens only when preserveEndOfLine is true.

After:

let config =
    [("number", "12368")
      ("date", "616165")
      ("code: ", "1616155")
      ("order reference", "561616")]

Repro code

Online tool

nojaf commented 5 years ago

This still happens with other types in arrays as well.

F.ex

let lst =
    [ 5
      6
      7 ]

Will be

let lst =
    [5
      6
      7]

SpaceAroundDelimiter = false.

nojaf commented 5 years ago

Cannot happen anymore since trivia.