Razor switch expression format

There seems to be a bug with formatting switch expressions in Razor. The closing brace is being indented in Razor files, but not in C# files.

Razor file example: 

@(subItem switch
{
  GbPage gbp => gbp.MenuDescription,
    TextPage tp => tp.MenuDescription,
    _ => null
    })

Same code formatted in a C# file:

        subItem switch
        {
           GbPage gbp => gbp.MenuDescription,
            TextPage tp => tp.MenuDescription,
            _ => null
        }

 

I can't seem to find any settings that pertain to this indenting issue in specifically Razor files.

1
1 comment
Hi,

this happens to be a known issue - https://youtrack.jetbrains.com/issue/RSRP-485522/.  Please follow it to get  the latest updates on the fix.
Let me know if you have any more questions.
0

Please sign in to leave a comment.