I have my .editorconfig set up for my project, and it mostly works well, but I've seen a problem where it doesn't seem to recognize my object initializer preference. This feels similar to #30529, but I'm still having the problem even though that was marked as resolved.
In my .editorconfig, I have the following settings (among more, which I can post if needed to see if there's something else overriding it):
csharp_new_line_before_open_brace = all
csharp_new_line_before_members_in_object_initializers = true
Expected Behavior:
I want my object intialization to look like this:
var obj = new MyObject
{
Prop1 = 7373,
Prop2 = "Hello world",
};
Actual Behavior:
When I run the code cleanup, it reformats the object initialization to:
var obj = new MyObject {
Prop1 = 7373,
Prop2 = "Hello world",
};
Version Used: Visual Studio 16.1.4
Steps to Reproduce:
I have my
.editorconfig
set up for my project, and it mostly works well, but I've seen a problem where it doesn't seem to recognize my object initializer preference. This feels similar to #30529, but I'm still having the problem even though that was marked as resolved.In my
.editorconfig
, I have the following settings (among more, which I can post if needed to see if there's something else overriding it):Expected Behavior:
I want my object intialization to look like this:
Actual Behavior:
When I run the code cleanup, it reformats the object initialization to: