Skip to content

Don't insert parenthesis in smart break line if user didn't type them#82059

Merged
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
DoctorKrolic:no-parenthesis-in-initializer
Jan 17, 2026
Merged

Don't insert parenthesis in smart break line if user didn't type them#82059
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
DoctorKrolic:no-parenthesis-in-initializer

Conversation

@DoctorKrolic
Copy link
Contributor

Fixes: #80753

@DoctorKrolic DoctorKrolic requested a review from a team as a code owner January 17, 2026 16:04
@dotnet-policy-service dotnet-policy-service bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Jan 17, 2026
{
if (addingInitializer)
{
// If we are adding an initializer and user didn't type constructor parenthesis,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we know the user didn't type constructor parentheses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause if they did we would have exit above:

if (argumentList is { IsMissing: false })
{
return baseObjectCreationExpressionNode;
}

@CyrusNajmabadi CyrusNajmabadi merged commit f83f4a8 into dotnet:main Jan 17, 2026
25 of 26 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jan 17, 2026
@DoctorKrolic DoctorKrolic deleted the no-parenthesis-in-initializer branch January 17, 2026 17:25
@davidwengier davidwengier modified the milestones: Next, 18.4 Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart break line should not insert parentheses if I didn't type them

3 participants