How to turn off autoformat which is getting rid of curly bracket spacing in collection initializer?

autoformatting, c#, curly-braces, resharper, visual-studio-2013

Solution

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

Problem

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.

Original source