Closed Lowfeye closed 6 months ago
The first parameter is long enough that it breaks, the second parameter fits within the width and nothing is forcing it to break.
I could see having a rule for "collection initializers that call constructors of objects should automatically break if there are 3 or more objects in the initializer". Which would result in
// input
var array = new SomeObject[] { new(1, 0), new(1, 0), new(1, 0) };
// output
var array = new SomeObject[]
{
new(1, 0),
new(1, 0),
new(1, 0)
};
Object initializers have a similar rule and auto break with 3+ properties.
var x = new X
{
x = 1,
y = 2,
z = 3
};
I thought it was two consecutive arrays that caused no line breaks. Now this is OK, thank you.
Input:
Output:
Expected behavior: