csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

AnonymousMethodExpressionSyntax breaking early

Open belav opened this issue 4 years ago • 0 comments

This is related to https://github.com/belav/csharpier/issues/100 but the solution to other nodes like IfStatementSyntax isn't easily implemented for AnonymousMethodExpressions. Adding a group around Func<string, string, bool> f5 = delegate(string exactly80, string abcd) is not easily possible.

This is also only the difference of about 2 characters, so it may not be worth the effort.

Expected result is

class ClassName
{
    void MethodName()
    {
        Func<string, string, bool> f5 = delegate(string exactly80, string abcd)
        {
            return false;
        };
    }
}

But actual result is

class ClassName
{
    void MethodName()
    {
        Func<string, string, bool> f5 = delegate(
            string exactly80,
            string abcd
        ) {
            return false;
        };
    }
}

belav avatar Apr 26 '21 19:04 belav