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 10:55 AM

Print

Comments on this entry:

# re: ReSharper: Fixing array and object initializer indentation

Left by Lars Udengaard at 5/1/2009 10:01 AM
Gravatar
How do you get the brackets to stand inline with the type declaration?

See here for explination:
stackoverflow.com/.../custom-brace-formatting-w...

/Lars

Your comment:



 (will not be displayed)


 
 
 
Please add 1 and 5 and type the answer here:
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
28123456
78910111213