diff --git a/src/Fantomas.Core/AstTransformer.fs b/src/Fantomas.Core/AstTransformer.fs index 403d4095ef..b319192780 100644 --- a/src/Fantomas.Core/AstTransformer.fs +++ b/src/Fantomas.Core/AstTransformer.fs @@ -447,15 +447,9 @@ module private Ast = |> finalContinuation) | SynExpr.LetOrUse (_, _, bindings, body, _, trivia) -> visit body (fun nodes -> - mkSynExprNode - SynExpr_LetOrUse - synExpr - synExpr.Range - (sortChildren - [| yield! (List.map visitSynBinding bindings) - yield! Option.toList (mkNodeOption SynExpr_LetOrUse_In trivia.InKeyword) - yield! nodes |]) - |> List.singleton + [ yield! (List.map visitSynBinding bindings) + yield! Option.toList (mkNodeOption SynExpr_LetOrUse_In trivia.InKeyword) + yield! nodes ] |> finalContinuation) | SynExpr.TryWith (tryExpr, withCases, diff --git a/src/Fantomas.Core/CodePrinter.fs b/src/Fantomas.Core/CodePrinter.fs index af41d0d50a..a2bb584f8a 100644 --- a/src/Fantomas.Core/CodePrinter.fs +++ b/src/Fantomas.Core/CodePrinter.fs @@ -3810,7 +3810,10 @@ and genTypeDefn +> genEq SynTypeDefn_Equals equalsRange +> indent +> sepNln - +> genMemberDefnList { astContext with InterfaceRange = None } others + +> genTriviaFor + SynTypeDefnRepr_ObjectModel + tdr.Range + (genMemberDefnList { astContext with InterfaceRange = None } others) +> unindent | ExceptionRepr (ExceptionDefRepr (ats, px, ao, uc)) -> genExceptionBody astContext ats px ao uc diff --git a/src/Fantomas.Core/TriviaTypes.fs b/src/Fantomas.Core/TriviaTypes.fs index 2d59f49efd..cbfd1feea6 100644 --- a/src/Fantomas.Core/TriviaTypes.fs +++ b/src/Fantomas.Core/TriviaTypes.fs @@ -104,7 +104,7 @@ type FsAstType = | SynExpr_TypeApp | SynExpr_TypeApp_Less | SynExpr_TypeApp_Greater - | SynExpr_LetOrUse + // | SynExpr_LetOrUse use first nested SynExpr | SynExpr_LetOrUse_In | SynExpr_TryWith | SynExpr_TryWith_Try