Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get implicit object creation consistent with explicit creation #1366

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading