Search code examples
c#visual-studioresharperobject-initializers

Resharper - use object initializer refactor - how to retain parentheses on constructor call?


When I use Resharper to refactor my code to use an Object initializer, it reformats the code correctly as thus, the following code

var response = new Response(); 
response.Value = "My value";

becomes

var response = new Response
{
   Value = "My value",
};

I can't find anyplace in Resharper options where I can set it up to retain the parentheses as part of the constructor code (which I prefer for consistency). Is it possible? I would like Resharper to format it thus:

var response = new Response()
{
   Value = "My value",
};

Solution

  • Sounds like this feature is not available in Resharper.