dotnet / format

Home for the dotnet-format command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Line wrapping and indentation of Collection Literals

ignatz opened this issue · comments

Output of running dotnet format with default config:

class Foo { }

class Program
{
    public static void Main()
    {

        List<List<Foo>> list = [[
          new Foo(),
            new Foo(),
            new Foo(),
        ],
            [
          new Foo(),
                new Foo(),
            ],
        ];

        Console.WriteLine($"Hello {list}");
    }
}

Just for some inspiration, the same program in dart:

class Foo {}

void main() {
  List<List<Foo>> list = [
    [
      Foo(),
      Foo(),
      Foo(),
    ],
    [
      Foo(),
      Foo(),
    ],
  ];

  print('Hello ${list}');
}