I can't get BSD style braces layout working for switch expressions

My switch expressions are formatted like this:

var weekend = DateTime.Today.DayOfWeek switch
{
DayOfWeek.Saturday => true,
DayOfWeek.Sunday => true,
_ => false
};

But I want them like this:

var weekend = DateTime.Today.DayOfWeek switch
{
DayOfWeek.Saturday => true,
DayOfWeek.Sunday => true,
_ => false
};

It works when I use Visual Studio or Visual Studio Code auto format, but not with ReSharper. I thought this would be enough:

But it works for everything but the switch expressions. Am I missing something, or is this a bug?

2 comments
Comment actions Permalink

Hello Peter,

 

thank you for contacting us.

Please check that the following option is disabled - ReSharper | Options | Code Editing | C# | Formatting Style | Tabs, Indents, Alignment | Align multiline constructs | Array, object and collection initializer.

Thank you.

0
Comment actions Permalink

That alone didn't help. I have made multiple changes in the settings now and got it to work as I want, but I'm not sure which ones actually helped. Thanks for the answer anyway!

0

Please sign in to leave a comment.