Skip to content

Commit

Permalink
Fixes 312
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Jul 17, 2019
1 parent 163d4bb commit 2a4dde1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Fantomas.Tests/DataStructureTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,14 @@ let ``multiline list should print each item on newline`` () =
"ddddddddddddddddddddddddddddddddddddddddd"
"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
"ffffffffffffffffffffffffffffffffffffffff" ]
"""

[<Test>]
let ``multiline list of string should not add ;`` () =
formatSourceString false """
[ "_Binaries/AltCover/Debug+AnyCPU/AltCover.exe"
"_Binaries/AltCover.Shadow/Debug+AnyCPU/AltCover.Shadow.dll" ]
""" ({ config with PageWidth = 80 })
|> should equal """[ "_Binaries/AltCover/Debug+AnyCPU/AltCover.exe"
"_Binaries/AltCover.Shadow/Debug+AnyCPU/AltCover.Shadow.dll" ]
"""
2 changes: 1 addition & 1 deletion src/Fantomas/CodePrinter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ and genExpr astContext synExpr =
let isMultiline (ctx:Context) =
xs
|> List.fold (fun (isMultiline, f) e ->
if isMultiline || futureNlnCheck f ctx then
if isMultiline || futureNlnCheck (f +> genExpr astContext e) ctx then
true, sepNone
else
false, f +> genExpr astContext e
Expand Down

0 comments on commit 2a4dde1

Please sign in to comment.