Can Resharper auto format 'case' statements onto a single line?

202 views Asked by At

I'm trying to find a way to have resharper auto-format single line case statements as shown:

switch (number)
{
    case 0: return 50;
    case 1: return 51;
    default: return 0;
}

Currently it formats like this:

switch (number)
{
    case 0: 
        return 50;
    case 1: 
        return 51;
    default: 
        return 0;
}
1

There are 1 answers

0
Drew Noakes On

As of R# 9.1 this is not supported. However there is an item in the ReSharper issue tracker that you can follow and/or vote on if you'd like to see this included. Currently it has 'critical' priority which suggests it's something that's being considered to inclusion.

https://youtrack.jetbrains.com/issue/RSRP-388810