diff --git a/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj b/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj index a2705007cf..5b8204b0bc 100644 --- a/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj +++ b/src/Fantomas.Core.Tests/Fantomas.Core.Tests.fsproj @@ -90,28 +90,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Fantomas.Core.Tests/FormatConfigEditorConfigurationFileTests.fs b/src/Fantomas.Core.Tests/FormatConfigEditorConfigurationFileTests.fs index 7418b073d5..eff291ca57 100644 --- a/src/Fantomas.Core.Tests/FormatConfigEditorConfigurationFileTests.fs +++ b/src/Fantomas.Core.Tests/FormatConfigEditorConfigurationFileTests.fs @@ -465,7 +465,7 @@ insert_final_newline = false Assert.IsFalse config.InsertFinalNewline [] -let ``Stroupstrup style`` () = +let ``Stroustrup style`` () = let rootDir = tempName () let editorConfig = diff --git a/src/Fantomas.Core.Tests/Stroupstrup/DotIndexedSetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/DotIndexedSetExpressionTests.fs similarity index 99% rename from src/Fantomas.Core.Tests/Stroupstrup/DotIndexedSetExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/DotIndexedSetExpressionTests.fs index 5ad7be70a7..9efb86d8b9 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/DotIndexedSetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/DotIndexedSetExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.DotIndexedSetExpressionTests +module Fantomas.Core.Tests.Stroustrup.DotIndexedSetExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/DotSetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/DotSetExpressionTests.fs similarity index 97% rename from src/Fantomas.Core.Tests/Stroupstrup/DotSetExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/DotSetExpressionTests.fs index 27226b45d4..dd2baf1a32 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/DotSetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/DotSetExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.DotSetExpressionTests +module Fantomas.Core.Tests.Stroustrup.DotSetExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/ElmishTests.fs b/src/Fantomas.Core.Tests/Stroustrup/ElmishTests.fs similarity index 100% rename from src/Fantomas.Core.Tests/Stroupstrup/ElmishTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/ElmishTests.fs diff --git a/src/Fantomas.Core.Tests/Stroupstrup/FunctionApplicationDualListTests.fs b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationDualListTests.fs similarity index 95% rename from src/Fantomas.Core.Tests/Stroupstrup/FunctionApplicationDualListTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationDualListTests.fs index bfc6fbf15d..d7d5755a70 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/FunctionApplicationDualListTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationDualListTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.FunctionApplicationDualListTests +module Fantomas.Core.Tests.Stroustrup.FunctionApplicationDualListTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/FunctionApplicationSingleListTests.fs b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationSingleListTests.fs similarity index 95% rename from src/Fantomas.Core.Tests/Stroupstrup/FunctionApplicationSingleListTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationSingleListTests.fs index ff2fe78748..d7c56312c7 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/FunctionApplicationSingleListTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/FunctionApplicationSingleListTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.FunctionApplicationSingleListTests +module Fantomas.Core.Tests.Stroustrup.FunctionApplicationSingleListTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/KeepIndentInBranchExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/KeepIndentInBranchExpressionTests.fs similarity index 97% rename from src/Fantomas.Core.Tests/Stroupstrup/KeepIndentInBranchExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/KeepIndentInBranchExpressionTests.fs index c45fb21d1e..511e7bc019 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/KeepIndentInBranchExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/KeepIndentInBranchExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.KeepIndentInBranchExpressionTests +module Fantomas.Core.Tests.Stroustrup.KeepIndentInBranchExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/LambdaExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/LambdaExpressionTests.fs similarity index 99% rename from src/Fantomas.Core.Tests/Stroupstrup/LambdaExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/LambdaExpressionTests.fs index 52ce73baee..5f3bf22aad 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/LambdaExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/LambdaExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.LambdaExpressionTests +module Fantomas.Core.Tests.Stroustrup.LambdaExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/LetOrUseBangExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/LetOrUseBangExpressionTests.fs similarity index 97% rename from src/Fantomas.Core.Tests/Stroupstrup/LetOrUseBangExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/LetOrUseBangExpressionTests.fs index 6346fd755e..9eb6d0f0c6 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/LetOrUseBangExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/LetOrUseBangExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.LetOrUseBangExpressionTests +module Fantomas.Core.Tests.Stroustrup.LetOrUseBangExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/LongIdentSetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/LongIdentSetExpressionTests.fs similarity index 97% rename from src/Fantomas.Core.Tests/Stroupstrup/LongIdentSetExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/LongIdentSetExpressionTests.fs index 5e731ec80c..9d7add6aee 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/LongIdentSetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/LongIdentSetExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.LongIdentSetExpressionTests +module Fantomas.Core.Tests.Stroustrup.LongIdentSetExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/MultiLineLambdaClosingNewlineExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/MultiLineLambdaClosingNewlineExpressionTests.fs similarity index 99% rename from src/Fantomas.Core.Tests/Stroupstrup/MultiLineLambdaClosingNewlineExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/MultiLineLambdaClosingNewlineExpressionTests.fs index f9b1f3f91f..c076331e62 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/MultiLineLambdaClosingNewlineExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/MultiLineLambdaClosingNewlineExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.MultiLineLambdaClosingNewlineExpressionTests +module Fantomas.Core.Tests.Stroustrup.MultiLineLambdaClosingNewlineExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/NamedArgumentExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/NamedArgumentExpressionTests.fs similarity index 99% rename from src/Fantomas.Core.Tests/Stroupstrup/NamedArgumentExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/NamedArgumentExpressionTests.fs index 16401dcc87..3c055ccb6b 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/NamedArgumentExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/NamedArgumentExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.NamedArgumentExpressionTests +module Fantomas.Core.Tests.Stroustrup.NamedArgumentExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SetExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SetExpressionTests.fs similarity index 97% rename from src/Fantomas.Core.Tests/Stroupstrup/SetExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SetExpressionTests.fs index 914b4a17af..146997d36a 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SetExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SetExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SetExpressionTests +module Fantomas.Core.Tests.Stroustrup.SetExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionExpressionTests.fs similarity index 98% rename from src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionExpressionTests.fs index 481a38af77..687668e3fe 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynBindingFunctionExpressionTests +module Fantomas.Core.Tests.Stroustrup.SynBindingFunctionExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionLongPatternExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionLongPatternExpressionTests.fs similarity index 99% rename from src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionLongPatternExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionLongPatternExpressionTests.fs index e25931cdc8..1150d724c7 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionLongPatternExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionLongPatternExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynBindingFunctionLongPatternExpressionTests +module Fantomas.Core.Tests.Stroustrup.SynBindingFunctionLongPatternExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionWithReturnTypeExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionWithReturnTypeExpressionTests.fs similarity index 98% rename from src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionWithReturnTypeExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionWithReturnTypeExpressionTests.fs index ac20a8d927..a2ad3f6c4d 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingFunctionWithReturnTypeExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingFunctionWithReturnTypeExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynBindingFunctionWithReturnTypeExpressionTests +module Fantomas.Core.Tests.Stroustrup.SynBindingFunctionWithReturnTypeExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingValueExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynBindingValueExpressionTests.fs similarity index 98% rename from src/Fantomas.Core.Tests/Stroupstrup/SynBindingValueExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynBindingValueExpressionTests.fs index 8b522a441e..fbe640dfb3 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynBindingValueExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynBindingValueExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynBindingValueExpressionTests +module Fantomas.Core.Tests.Stroustrup.SynBindingValueExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynExprAndBangExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynExprAndBangExpressionTests.fs similarity index 98% rename from src/Fantomas.Core.Tests/Stroupstrup/SynExprAndBangExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynExprAndBangExpressionTests.fs index 1abcc79ef7..7c716ad232 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynExprAndBangExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynExprAndBangExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynExprAndBangExpressionTests +module Fantomas.Core.Tests.Stroustrup.SynExprAndBangExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynMatchClauseExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynMatchClauseExpressionTests.fs similarity index 99% rename from src/Fantomas.Core.Tests/Stroupstrup/SynMatchClauseExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynMatchClauseExpressionTests.fs index f87cdc50fc..d34efbb091 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynMatchClauseExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynMatchClauseExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynMatchClauseExpressionTests +module Fantomas.Core.Tests.Stroustrup.SynMatchClauseExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynTypeDefnSigReprSimpleTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSigReprSimpleTests.fs similarity index 96% rename from src/Fantomas.Core.Tests/Stroupstrup/SynTypeDefnSigReprSimpleTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSigReprSimpleTests.fs index 9c17067b11..71b5ce63ba 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynTypeDefnSigReprSimpleTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSigReprSimpleTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynTypeDefnSigReprSimpleTests +module Fantomas.Core.Tests.Stroustrup.SynTypeDefnSigReprSimpleTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/SynTypeDefnSimpleReprRecordTests.fs b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSimpleReprRecordTests.fs similarity index 96% rename from src/Fantomas.Core.Tests/Stroupstrup/SynTypeDefnSimpleReprRecordTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSimpleReprRecordTests.fs index 06f7cf7d2b..f38afa73b4 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/SynTypeDefnSimpleReprRecordTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/SynTypeDefnSimpleReprRecordTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.SynTypeDefnSimpleReprRecordTests +module Fantomas.Core.Tests.Stroustrup.SynTypeDefnSimpleReprRecordTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/YieldOrReturnBangExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnBangExpressionTests.fs similarity index 98% rename from src/Fantomas.Core.Tests/Stroupstrup/YieldOrReturnBangExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnBangExpressionTests.fs index b1ff882c08..a3c6e4a9da 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/YieldOrReturnBangExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnBangExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.YieldOrReturnBangExpressionTests +module Fantomas.Core.Tests.Stroustrup.YieldOrReturnBangExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core.Tests/Stroupstrup/YieldOrReturnExpressionTests.fs b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnExpressionTests.fs similarity index 98% rename from src/Fantomas.Core.Tests/Stroupstrup/YieldOrReturnExpressionTests.fs rename to src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnExpressionTests.fs index b3e1c37f34..123492325c 100644 --- a/src/Fantomas.Core.Tests/Stroupstrup/YieldOrReturnExpressionTests.fs +++ b/src/Fantomas.Core.Tests/Stroustrup/YieldOrReturnExpressionTests.fs @@ -1,4 +1,4 @@ -module Fantomas.Core.Tests.Stroupstrup.YieldOrReturnExpressionTests +module Fantomas.Core.Tests.Stroustrup.YieldOrReturnExpressionTests open NUnit.Framework open FsUnit diff --git a/src/Fantomas.Core/CodePrinter.fs b/src/Fantomas.Core/CodePrinter.fs index 5afa44dccc..8b35fed47c 100644 --- a/src/Fantomas.Core/CodePrinter.fs +++ b/src/Fantomas.Core/CodePrinter.fs @@ -2032,7 +2032,7 @@ and genExpr astContext synExpr ctx = +> sepNln +> (fun ctx -> let hasMultipleClausesWhereOneHasRagnarok = - hasMultipleClausesWhereOneHasStroupstrup ctx.Config.ExperimentalStroustrupStyle cs + hasMultipleClausesWhereOneHasStroustrup ctx.Config.ExperimentalStroustrupStyle cs col sepNln cs (genClause astContext true hasMultipleClausesWhereOneHasRagnarok) ctx) ) @@ -4612,7 +4612,7 @@ and genClauses astContext cs (ctx: Context) = col sepNln cs - (genClause astContext true (hasMultipleClausesWhereOneHasStroupstrup ctx.Config.ExperimentalStroustrupStyle cs)) + (genClause astContext true (hasMultipleClausesWhereOneHasStroustrup ctx.Config.ExperimentalStroustrupStyle cs)) ctx /// Each multiline member definition has a pre and post new line. @@ -5500,7 +5500,7 @@ and genKeepIndentMatch +> sepNln +> (fun ctx -> let hasMultipleClausesWhereOneHasRagnarok = - hasMultipleClausesWhereOneHasStroupstrup ctx.Config.ExperimentalStroustrupStyle clauses + hasMultipleClausesWhereOneHasStroustrup ctx.Config.ExperimentalStroustrupStyle clauses coli sepNln diff --git a/src/Fantomas.Core/Context.fs b/src/Fantomas.Core/Context.fs index 295ef4db26..18c3190fe0 100644 --- a/src/Fantomas.Core/Context.fs +++ b/src/Fantomas.Core/Context.fs @@ -1280,7 +1280,7 @@ let internal addExtraNewlineIfLeadingWasMultiline leading sepNlnConsideringTrivi let internal autoIndentAndNlnExpressUnlessRagnarok (f: SynExpr -> Context -> Context) (e: SynExpr) (ctx: Context) = match e with - | SourceParser.StroupstrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx + | SourceParser.StroustrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx | _ -> (indent +> sepNln +> f e +> unindent) ctx let internal autoIndentAndNlnIfExpressionExceedsPageWidthUnlessRagnarok @@ -1289,7 +1289,7 @@ let internal autoIndentAndNlnIfExpressionExceedsPageWidthUnlessRagnarok (ctx: Context) = match e with - | SourceParser.StroupstrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx + | SourceParser.StroustrupStyleExpr ctx.Config.ExperimentalStroustrupStyle e -> f e ctx | _ -> autoIndentAndNlnIfExpressionExceedsPageWidth (f e) ctx type internal ColMultilineItem = diff --git a/src/Fantomas.Core/SourceParser.fs b/src/Fantomas.Core/SourceParser.fs index 196e20a96f..4991a0e378 100644 --- a/src/Fantomas.Core/SourceParser.fs +++ b/src/Fantomas.Core/SourceParser.fs @@ -1801,8 +1801,8 @@ let (|KeepIndentIfThenElse|_|) (e: SynExpr) = None | _ -> None -let (|StroupstrupStyleExpr|_|) (isStroupstrupStyleEnabled: bool) (e: SynExpr) = - if not isStroupstrupStyleEnabled then +let (|StroustrupStyleExpr|_|) (isStroustrupStyleEnabled: bool) (e: SynExpr) = + if not isStroustrupStyleEnabled then None else match e with @@ -1815,12 +1815,12 @@ let (|StroupstrupStyleExpr|_|) (isStroupstrupStyleEnabled: bool) (e: SynExpr) = | ArrayOrList _ -> Some e | _ -> None -let hasMultipleClausesWhereOneHasStroupstrup isStroupstrupStyleEnabled (cs: SynMatchClause list) : bool = - isStroupstrupStyleEnabled +let hasMultipleClausesWhereOneHasStroustrup isStroustrupStyleEnabled (cs: SynMatchClause list) : bool = + isStroustrupStyleEnabled && List.moreThanOne cs && List.exists (fun (SynMatchClause (resultExpr = e)) -> match e with - | StroupstrupStyleExpr isStroupstrupStyleEnabled _ -> true + | StroustrupStyleExpr isStroustrupStyleEnabled _ -> true | _ -> false) cs