Search code examples
c#resharperwhitespacevisual-studio-2022

ReSharper not applying the 'new' parenthesis space formatting rule in Code Cleanup


It is not a duplicate question. Because my question asks why Resharper stopped making spaces, however, another question is asking how to add spaces. It is two different questions.

I've set a settings to add a space before new parentheses to have a space between new and ():

List<int> list = new ();

The setting in Resharper looks like this:

enter image description here

However, after running Resharper Code clean up space is not occured:

enter image description here

And the result looks like this:

enter image description here

Could you tell please how to add space between new and () after running Code cleanup?


Solution

  • As far as I see, the "Reformat code" item in the custom code cleanup profile has been excluded. Try turning it on or using the "Built-in: Full Cleanup" profile.