File tree Expand file tree Collapse file tree 4 files changed +47
-0
lines changed
Expand file tree Collapse file tree 4 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ 6.0.1] - 2023-04-19
4+
5+ ### Fixed
6+ * Invalid code: moved line comment. [ #2847 ] ( https://github.com/fsprojects/fantomas/issues/2847 )
7+
38## [ 6.0.0] - 2023-04-13
49
510### Fixed
Original file line number Diff line number Diff line change 127127 <Compile Include =" TryWithTests.fs" />
128128 <Compile Include =" CursorTests.fs" />
129129 <Compile Include =" MultipleDefineCombinationsTests.fs" />
130+ <Compile Include =" ParenthesesTests.fs" />
130131 </ItemGroup >
131132 <ItemGroup >
132133 <ProjectReference Include =" ..\Fantomas.Core\Fantomas.Core.fsproj" />
Original file line number Diff line number Diff line change 1+ module Fantomas.Core.Tests.ParenthesesTests
2+
3+ open NUnit.Framework
4+ open FsUnit
5+ open Fantomas.Core .Tests .TestHelpers
6+
7+ [<Test>]
8+ let ``trivia after opening parenthesis , 2847`` () =
9+ formatSourceString
10+ false
11+ """
12+ let canConvertMemorised =
13+ Memoized.memoize
14+ (fun objectType ->
15+ ( // Include F# discriminated unions
16+ FSharpType.IsUnion objectType
17+ // and exclude the standard FSharp lists (which are implemented as discriminated unions)
18+ && not (objectType.GetTypeInfo().IsGenericType && objectType.GetGenericTypeDefinition() = typedefof<_ list>)
19+ )
20+ // include tuples
21+ || tupleAsHeterogeneousArray && FSharpType.IsTuple objectType
22+ )
23+ """
24+ config
25+ |> prepend newline
26+ |> should
27+ equal
28+ """
29+ let canConvertMemorised =
30+ Memoized.memoize (fun objectType ->
31+ ( // Include F# discriminated unions
32+ FSharpType.IsUnion objectType
33+ // and exclude the standard FSharp lists (which are implemented as discriminated unions)
34+ && not (
35+ objectType.GetTypeInfo().IsGenericType
36+ && objectType.GetGenericTypeDefinition() = typedefof<_ list>
37+ ))
38+ // include tuples
39+ || tupleAsHeterogeneousArray && FSharpType.IsTuple objectType)
40+ """
Original file line number Diff line number Diff line change @@ -712,6 +712,7 @@ let genExpr (e: Expr) =
712712 +> genSingleTextNode node.ClosingParen
713713 | _ ->
714714 genSingleTextNode node.OpeningParen
715+ +> sepNlnWhenWriteBeforeNewlineNotEmpty
715716 +> genExpr node.Expr
716717 +> genSingleTextNode node.ClosingParen
717718 |> genNode node
You can’t perform that action at this time.
0 commit comments