Line Wrapping Array & Object Initializers

Hi all.

I'm trying to get my code reformatting settings working so that simple arrays and objects get placed on one line and arrays and objects with more than two lines in their object initializers get wrapped.

My settings:

Line Breaks and Wrapping -> Line Wrapping -> Wrap object and collection initializer = Chop if long
Line Breaks and Wrapping -> Other -> Place simple array, objtec and collection on  single line = checked


So formatting would look something like this:

string[] stringArray1 = new string[] { "a", "b" };
string[] stringArray2 = new string[]
{
  "apple",
  "banana",
  "cantelope",
  "date"
};


Thanks.

Please sign in to leave a comment.