I can't get BSD style braces layout working for switch expressions Follow
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?
Please sign in to leave a comment.
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.
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!