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

Inconsistent placement of end parenthesis #1079

Closed
loraderon opened this issue Dec 19, 2023 · 1 comment
Closed

Inconsistent placement of end parenthesis #1079

loraderon opened this issue Dec 19, 2023 · 1 comment

Comments

@loraderon
Copy link
Contributor

Using the latest 0.26.7 in the playground that reverted #1010, there are some inconsistencies in the intentation of the method call and primarily the end parenthesis ).

Input:

public class ClassName
{
    public void Test()
    {
        var foo = new { Bars = new string[0] };

        foo.Bars.Select(s => s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()).ToArray();
        
        foo.Select(s => s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()).ToArray();
    }
}

Output:

public class ClassName
{
    public void Test()
    {
        var foo = new { Bars = new string[0] };

        foo.Bars.Select(
            s => s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()
        )
            .ToArray();

        foo.Select(
                s => s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()
            )
            .ToArray();
    }
}

Expected behavior:

Either

        foo.Bars.Select(
                s => s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()
            )
            .ToArray();

Or

        foo.Bars.Select(
            s => s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()
        )
        .ToArray();
@loraderon
Copy link
Contributor Author

I have verified that this now works correctly in 0.27.1 🎉

Output in the playground:

public class ClassName
{
    public void Test()
    {
        var foo = new { Bars = new string[0] };

        foo
            .Bars.Select(s =>
                s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()
            )
            .ToArray();

        foo.Select(s =>
                s.ToString().ToString().ToString().ToString().ToString().ToString().ToString()
            )
            .ToArray();
    }
}

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

No branches or pull requests

1 participant