-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't remove "in" from "let ... in ..." binding. (#342)
* test * Use "let .. in .." if pattern and expr are at the same line. * Added fix for comment after in * Revert removed lines from fsproj * Merge fix * Fixed failing tests
- Loading branch information
1 parent
693baa3
commit 60d0ac5
Showing
9 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,8 +215,6 @@ namespace Internal.Utilities.Diagnostic | |
type ExtensibleDumper = A | B | ||
#endif | ||
#endif | ||
""" | ||
|
||
[<Test>] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module Fantomas.Tests.LetBindingTests | ||
|
||
open NUnit.Framework | ||
open FsUnit | ||
|
||
open Fantomas.CodeFormatter | ||
open Fantomas.Tests.TestHelper | ||
|
||
[<Test>] | ||
let ``let in should be preserved``() = | ||
formatSourceString false "let x = 1 in ()" config | ||
|> should equal """let x = 1 in () | ||
""" | ||
|
||
[<Test>] | ||
let ``let in should be preserved with PreserveEOL option``() = | ||
formatSourceString false "let x = 1 in ()" { config with PreserveEndOfLine = true } | ||
|> should equal """let x = 1 in () | ||
""" | ||
|
||
[<Test>] | ||
let ``multiple let in lines, should remove in`` () = | ||
let codeSnippet = """ | ||
let f () = | ||
let x = 1 in // the "in" keyword is available in F# | ||
let y = 2 in | ||
x + y | ||
""" | ||
|
||
formatSourceString false codeSnippet config | ||
|> should equal """let f() = | ||
let x = 1 // the "in" keyword is available in F# | ||
let y = 2 | ||
x + y | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters