belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.41k stars 99 forks source link

Bad wrapping and indentation on long switch expression branches matching on tuples #1275

Open domn1995 opened 5 months ago

domn1995 commented 5 months ago

Similar to #1271, I'm running into this issue:

Input:

void Fn()
{
    return x switch
    {
        (true, true) => foobar.MethodCall1().MethodCall2().MethodCall3(),
        // ...
    };
}

Output:

void Fn()
{
    return x switch
    {
        (true, true) 
           => foobar
              .MethodCall1()
              .MethodCall2()
              .MethodCall3(),
        // ...
    };
}

Expected:

void Fn()
{
    return x switch
    {
        (true, true) => 
            foobar.MethodCall1()
                .MethodCall2()
                .MethodCall3(),
        // ...
    };
}