4

I have visual studio 2013, Resharper 8.1 and Stylecop.

I'm not sure what setting is doing this, but I can't seem to find it!?

I pristine visual studio 2013 will take something like this:

var tmp = new List<string> {"this"};

and make it into this (like I want):

var tmp = new List<string> { "this" };

This happens upon typing the semicolon.

Right now my setup will do the opposite, it get's rid of the spaces (although it then grey underlines the braces because this is a StyleCop violation.

Where's the setting to HAVE spaces there, I've tried to go through all the VS and Resharper settings!?

Thanks for any insights.

adrianbanks
  • 81,306
  • 22
  • 176
  • 206
shawn.mek
  • 1,195
  • 1
  • 11
  • 17

1 Answers1

6

That's the default setting in my environment too (VS2012 / ReSharper 7).

You can change it in the ReSharper options:

Code Editing » C# » Formatting Style » Spaces » Within single-line initializer braces

enter image description here

Grant Winney
  • 65,241
  • 13
  • 115
  • 165