Skip to content

Commit

Permalink
Fix for fsprojects#370
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Dec 5, 2018
1 parent b24600d commit 70a1325
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Binary file modified .paket/paket.exe
Binary file not shown.
15 changes: 15 additions & 0 deletions src/Fantomas.Tests/PreserveEOLTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,18 @@ let lst =
7
]
"""

[<Test>]
let ``mulitple attributes should be indented correctly`` () =
formatSourceString false """
module Tests =
[<Theory>]
[<InlineData("Blah")>]
let x = 123
""" config
|> should equal """
module Tests =
[<Theory>]
[<InlineData("Blah")>]
let x = 123
"""
1 change: 1 addition & 0 deletions src/Fantomas/TokenMatcher.fs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ let integrateComments (config:Fantomas.FormatConfig.FormatConfig) compilationDef
let indentWithNewSpacing xs ys =
let rec newSpacingLength zs =
match zs with
| (EOL, _)::(Space _)::(Tok(_, _), "[<")::_::(Tok(_, _), ">]")::(EOL, _)::(Space _)::(Tok(_, _), "[<")::_ -> 3
| (EOL, _)::(Space _)::(Tok(_, _), "[<")::_ -> 2
| (EOL, _)::(EOL, _)::(Tok(_, _), "[<")::_ -> 0
| (EOL, _)::(Space _)::_ -> 1
Expand Down

0 comments on commit 70a1325

Please sign in to comment.