csharp_wrap_object_and_collection_initializer_style

chop_always gives every initializer element its own line. Only honoured in deterministic mode. wrap_if_long is not offered: dotnet format forces one member per line once an initializer opens out, so a packed layout could never stay put.

Value Notes
chop_always
chop_if_long

Default: chop_if_long

No known case where Curb's output is not a fixed point of dotnet format — see conformance.

Ini
max_line_length = 80
csharp_wrap_object_and_collection_initializer_style = chop_always
C#
namespace N;

public class Widget
{
    public object Make()
    {
        var small = new Point { X = 1, Y = 2 };
        return new Point
        {
            X = 1000,
            Y = 2000,
            Z = 3000,
            Label = "a point with a long label"
        };
    }
}
C#
namespace N;

public class Widget
{
    public object Make()
    {
        var small = new Point
        {
            X = 1,
            Y = 2
        };
        return new Point
        {
            X = 1000,
            Y = 2000,
            Z = 3000,
            Label = "a point with a long label"
        };
    }
}
Ini
max_line_length = 80
csharp_wrap_object_and_collection_initializer_style = chop_if_long
C#
namespace N;

public class Widget
{
    public object Make()
    {
        var small = new Point { X = 1, Y = 2 };
        return new Point { X = 1000, Y = 2000, Z = 3000, Label = "a point with a long label" };
    }
}
C#
namespace N;

public class Widget
{
    public object Make()
    {
        var small = new Point { X = 1, Y = 2 };
        return new Point
        {
            X = 1000,
            Y = 2000,
            Z = 3000,
            Label = "a point with a long label"
        };
    }
}