Skip to content

Commit

Permalink
get implicit object creation consistent with explicit creation
Browse files Browse the repository at this point in the history
closes #1364
  • Loading branch information
belav committed Oct 26, 2024
1 parent ebfb182 commit 4de5249
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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_______________________________________________________________________,
};
}
5 changes: 0 additions & 5 deletions Src/CSharpier/SyntaxPrinter/RightHandSide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4de5249

Please sign in to comment.