Skip to content

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

@Meowtimer

Description

@Meowtimer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions