R # Generate switch labels with curly braces in enclosures

Can I customize the template used by Resharper's "Generate Switch Labels" feature? I would prefer to automatically create curly braces below each label case

. After looking through the options, I don't see anything like it.

By default, I get the following:

switch (myEnum)
{
    case MyEnum.One:
        break;
    case MyEnum.Two:
        break;
    default:
        throw new ArgumentOutOfRangeException(nameof(myEnum), myEnum, null);
}

      

Whereas I would like to see this:

switch (myEnum)
{
    case MyEnum.One:
    {
        break;
    }
    case MyEnum.Two:
    {
        break;
    }
    default:
    {
        throw new ArgumentOutOfRangeException(nameof(myEnum), myEnum, null);
    }
}

      

+3


source to share





All Articles