csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

ConstructorDeclaration brace should newline

Open belav opened this issue 4 years ago • 0 comments

Currently when a constructor has short parameters, but a long base, it formats like so

    public WithParameters(string parameter)
        : base(
            longParameter____________________________________________________________________________
        ) {
        WithBody();
    }

I think we want it to format like so

    public WithParameters(string parameter)
        : base(
            longParameter____________________________________________________________________________
        )
    {
        WithBody();
    }

But with the current Doc functionality I don't believe this is possible. We need to say

If the Parameters Group does not break
   but the ConstructorInitializer Group does break
Then print the Block with a Doc.Line

This would be in BaseMethodDeclaration, line 225 or so

The other edge case that conflicts with this one

    public Initializers(
        string longParameter____________________________________________________________
    ) : base(false)
    {
        WithBody();
    }

belav avatar Jul 26 '21 17:07 belav