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

To SpaceBrace or not to SpaceBrace #144

Closed
belav opened this issue Apr 25, 2021 · 3 comments
Closed

To SpaceBrace or not to SpaceBrace #144

belav opened this issue Apr 25, 2021 · 3 comments

Comments

@belav
Copy link
Owner

belav commented Apr 25, 2021

This is the SpaceBrace
image

It is not how c# has really been formatted.
It is how prettier formats js/ts.
It may have not been used before prettier.
Should CSharpier not use SpaceBrace?

See #34 for some discussion

@belav
Copy link
Owner Author

belav commented Apr 25, 2021

After thing to consider. How will generic methods print? This is their current state, which will change. See #94

        public static Doc Print<T>(
            SeparatedSyntaxList<T> list,
            Func<T, Doc> printFunc,
            Doc afterSeparator
        )
            where T : SyntaxNode {
            var docs = new List<Doc>();
            return docs;
        }

@respel
Copy link

respel commented Jun 1, 2021

I think it's worthwhile to stick with what the community is doing, especially in cases where the mandate is clear. And this is one of them.

For the generic method, I think we can put the constraint on the same line as the parameter end bracket.

public static Doc Print<T>(
    SeparatedSyntaxList<T> list,
    Func<T, Doc> printFunc,
    Doc afterSeparator
) where T : SyntaxNode 
{
    var docs = new List<Doc>();
    return docs;
}

@belav
Copy link
Owner Author

belav commented Jul 19, 2021

We've settled on SpaceBrace and have generic methods formatting well. I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants