diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test index 0889ba6e4..f6faf39d1 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.test @@ -111,4 +111,15 @@ class MyClass HttpMethod.None, HttpMethod.Connect, ]; + + public List DaysOfWeek { get; } = + [ + DayOfWeek.Sunday, + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday + ]; } diff --git a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs index 91ecbde54..af2ce49c4 100644 --- a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs +++ b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/CollectionExpression.cs @@ -16,10 +16,7 @@ or InitializerExpressionSyntax or ExpressionStatementSyntax ) } - or EqualsValueClauseSyntax - { - Parent: not (PropertyDeclarationSyntax or VariableDeclaratorSyntax) - } + or EqualsValueClauseSyntax { Parent: not VariableDeclaratorSyntax } ? Doc.Null : Doc.IfBreak(Doc.Line, Doc.Null);