Formatting an Object Initializer

What settings in Resharper 8 reformat my object initializer, like this? (i.e. with a comma on its own line).

var snowDepthProcessor = new DataProcessor<SnowDepthModel> { Name = "Snow Depth" , DataRetriever = snowReportRetriever , Parser = new SnowDepthParser() , ... }; 

I tried every combination of settings that I can find / think; I want the lines to be cut, but I do not want the comma to be on its own line.

+4
source share
1 answer

I share your pain. I have to admit that my solution is partial, because changing the style requires what you would like to use for

 List<string> demo = new List<string> { "a", "b", "c" } 

Then the formatting does not change. I would also use the syntax that you described, so I created R # ticket https://youtrack.jetbrains.com/issue/RSRP-453704 , but so far it hasn't resolved it just how it suppresses that (it behaves the same even in the last R # 10)

EDIT: Good news. It seems to be fixed since R# 2017.1

0
source

Source: https://habr.com/ru/post/1496197/


All Articles