简体   繁体   中英

Can I make Visual Studio 2017 stop indenting braces for case?

Visual Studio indents braces in case like this:

switch(variable)
{
    case 0:
        {
            // some code
            break;
        }
}

However I would like it better without indentation:

switch(variable)
{
    case 0:
    {
        // some code
        break;
    }
}

I was looking through the options, but didn't find the one I want. Did I miss it or is it just not there?

Under Visual Studio

Options >> TextEditor >> C# >> Code Style >> Formatting >> Indentation

is what you are looking for. You will see several options under that menu and set your settings as you wish. In this case, the setting is called "Indent case contents" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM