From a49d1703900692c72ce5378c97316e2be4c01b83 Mon Sep 17 00:00:00 2001 From: nojaf Date: Mon, 30 Oct 2023 16:15:44 +0100 Subject: [PATCH] Remove blank line between type extension. --- src/Fantomas.Core.Tests/DallasTests.fs | 1 - .../NewlineBetweenTypeDefinitionAndMembersTests.fs | 4 +--- src/Fantomas.Core/CodePrinter.fs | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Fantomas.Core.Tests/DallasTests.fs b/src/Fantomas.Core.Tests/DallasTests.fs index 7b3aa8c704..9f5adc0e39 100644 --- a/src/Fantomas.Core.Tests/DallasTests.fs +++ b/src/Fantomas.Core.Tests/DallasTests.fs @@ -481,7 +481,6 @@ type Foo with equal """ type Foo with - member x.Bar = () """ diff --git a/src/Fantomas.Core.Tests/NewlineBetweenTypeDefinitionAndMembersTests.fs b/src/Fantomas.Core.Tests/NewlineBetweenTypeDefinitionAndMembersTests.fs index d88c1bbae1..4081e8942f 100644 --- a/src/Fantomas.Core.Tests/NewlineBetweenTypeDefinitionAndMembersTests.fs +++ b/src/Fantomas.Core.Tests/NewlineBetweenTypeDefinitionAndMembersTests.fs @@ -120,7 +120,7 @@ type Color = """ [] -let ``type augmentation with members`` () = +let ``type augmentation with members should not add newline`` () = formatSourceString false """ @@ -133,7 +133,6 @@ type HttpContext with equal """ type HttpContext with - member this.QueryString() = "?" """ @@ -232,7 +231,6 @@ type HttpContext with namespace Signature type HttpContext with - member QueryString: unit -> string """ diff --git a/src/Fantomas.Core/CodePrinter.fs b/src/Fantomas.Core/CodePrinter.fs index 7d77e5abf9..7b6dc4e97a 100644 --- a/src/Fantomas.Core/CodePrinter.fs +++ b/src/Fantomas.Core/CodePrinter.fs @@ -3518,7 +3518,7 @@ let genTypeDefn (td: TypeDefn) = header +> sepSpace +> optSingle genSingleTextNode typeName.WithKeyword - +> indentSepNlnUnindent (sepNlnBetweenTypeAndMembers typeDefnNode +> genMemberDefnList members) + +> indentSepNlnUnindent (genMemberDefnList members) |> genNode node | TypeDefn.Delegate node -> header