From b7331a1ba0614daf0ed230ffdbb552d5607bcc0d Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 29 Jul 2024 14:51:07 -0500 Subject: [PATCH] Fixing extra blank line in collection expression (#1310) closes #1306 --- .../TestFiles/cs/CollectionExpressions.test | 7 +++++++ .../SyntaxNodePrinters/CollectionExpression.cs | 1 + 2 files changed, 8 insertions(+) diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test index 2ee8b5ca8..27be13027 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test @@ -79,6 +79,13 @@ CallMethod( ] ); +CallMethod(_ => + [ + LongValue________________________________________________, + LongValue________________________________________________, + ] +); + int[] someArray = [ 1 diff --git a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs index 582c57d98..8fecfd4f0 100644 --- a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs +++ b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs @@ -9,6 +9,7 @@ public static Doc Print(CollectionExpressionSyntax node, FormattingContext conte or AttributeArgumentSyntax or ArrowExpressionClauseSyntax or ExpressionElementSyntax + or SimpleLambdaExpressionSyntax or AssignmentExpressionSyntax { Parent: not (