ReSharper: Fixing array and object initializer indentation

There are tons of options when it comes to configuring your coding style in ReSharper. Somehow I managed to screw the indentation of array and object initializers' variables. This is what it looked like (I use At Next Line (BSD style) setting):

int[] array = new int[]
{
1, 2, 3
}

To fix this, go to Formatting Style -> Other, and set the Continuous line indent multiplier to 1 (mine was 0)

image

And now it's back to normal:

int[] array = new int[]
{
  1, 2, 3
}

posted @ Wednesday, April 22, 2009 8:01 AM

Print

Comments on this entry:

# re: ReSharper: Fixing array and object initializer indentation

Left by Lars Udengaard at 5/1/2009 7:01 AM
Gravatar
How do you get the brackets to stand inline with the type declaration?<br /><br />See here for explination:<br />stackoverflow.com/.../custom-brace-formatting-w...<br /><br />/Lars

Your comment:



 (will not be displayed)


 
 
 
Please add 4 and 8 and type the answer here:
 

Live Comment Preview:

 
«September»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789