csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

Formatting for indexer parameters should mostly be the same as for method parameters.

Open Meowtimer opened this issue 1 year ago • 0 comments

Input:

public class Obj
{

    public string this[
        [A] int X,
        [B, VeryLongAttributeWithSoManyArguments(123, 321)] int Y,
        [C, LongAttributeThatIsLong] int Y
    ] => X + Y + Z;
    
    public string Method(
        [A] int X,
        [B, VeryLongAttributeWithSoManyArguments(123, 321)] int Y,
        [C, LongAttributeThatIsLong] int Y
    ) => X + Y + Z;    

}

Output:

public class Obj
{
    public string this[[A] int X, [B, VeryLongAttributeWithSoManyArguments(123, 321)] int Y, [
        C,
        LongAttributeThatIsLong
    ]
        int Y] => X + Y + Z;

    public string Method(
        [A] int X,
        [B, VeryLongAttributeWithSoManyArguments(123, 321)] int Y,
        [C, LongAttributeThatIsLong] int Y
    ) => X + Y + Z;
}

Expected behavior: Both indexer and Method being formatted similarly with multiple lines for parameters.

Meowtimer avatar May 08 '24 07:05 Meowtimer