fsprojects / fantomas

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

List expression items don't respect fsharp_blank_lines_around_nested_multiline_expressions #2856

Open cmeeren opened 1 year ago

cmeeren commented 1 year ago

Issue created from fantomas-online

Code

[ verylonglinethatwillbreak arg1 arg2 arg3 arg4 arg5 arg6 arg7
  verylonglinethatwillbreak arg1 arg2 arg3 arg4 arg5 arg6 arg7
  verylonglinethatwillbreak arg1 arg2 arg3 arg4 arg5 arg6 arg7 ]

Result

[ verylonglinethatwillbreak
      arg1
      arg2
      arg3
      arg4
      arg5
      arg6
      arg7
  verylonglinethatwillbreak
      arg1
      arg2
      arg3
      arg4
      arg5
      arg6
      arg7
  verylonglinethatwillbreak
      arg1
      arg2
      arg3
      arg4
      arg5
      arg6
      arg7 ]

Expected result

[ verylonglinethatwillbreak
      arg1
      arg2
      arg3
      arg4
      arg5
      arg6
      arg7

  verylonglinethatwillbreak
      arg1
      arg2
      arg3
      arg4
      arg5
      arg6
      arg7

  verylonglinethatwillbreak
      arg1
      arg2
      arg3
      arg4
      arg5
      arg6
      arg7 ]

Problem description

List items (whether using implicit/explicit yield or yield!) do not seem to follow fsharp_blank_lines_around_nested_multiline_expressions, as shown above.

Extra information

Options

Fantomas main branch at 1/1/1990

    { config with
                MaxLineLength = 60 }

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