diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.test b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.test index 19be407df..19cc7a121 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.test +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/cs/InitializerExpressions.test @@ -250,9 +250,39 @@ class ClassName { }; } - private SomeObject someObject = - new(someLongParameter___________________) - { - SomeProperty = someLongValue____________________________, - }; + SomeObject someObject = new() + { + Property = longValue_______________________________________________________________________, + }; + + SomeObject someObject = new SomeObject + { + Property = longValue_______________________________________________________________________, + }; + + SomeObject someObject = new(someLongParameter___________________) + { + Property = longValue_______________________________________________________________________, + }; + + SomeObject someObject = new SomeObject(someLongParameter___________________) + { + Property = longValue_______________________________________________________________________, + }; + + SomeObject someObject = new( + someLongParameter___________________, + someLongParameter___________________ + ) + { + Property = longValue_______________________________________________________________________, + }; + + SomeObject someObject = new SomeObject( + someLongParameter___________________, + someLongParameter___________________ + ) + { + Property = longValue_______________________________________________________________________, + }; } diff --git a/Src/CSharpier/SyntaxPrinter/RightHandSide.cs b/Src/CSharpier/SyntaxPrinter/RightHandSide.cs index 29f15af56..5fa39669f 100644 --- a/Src/CSharpier/SyntaxPrinter/RightHandSide.cs +++ b/Src/CSharpier/SyntaxPrinter/RightHandSide.cs @@ -118,14 +118,9 @@ or ConditionalExpressionSyntax WhenFalse: ConditionalExpressionSyntax, WhenTrue: not ConditionalExpressionSyntax } - or ImplicitObjectCreationExpressionSyntax { Parent: EqualsValueClauseSyntax } or InterpolatedStringExpressionSyntax - // TODO ditch fluid? - // or InvocationExpressionSyntax or IsPatternExpressionSyntax or LiteralExpressionSyntax - // TODO ditch fluid? - // or MemberAccessExpressionSyntax or StackAllocArrayCreationExpressionSyntax or QueryExpressionSyntax => Layout.BreakAfterOperator, _ => Layout.Fluid,