microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.09k stars 29.26k forks source link

C/CPP should deindent preprocessor directives #31856

Closed roblourens closed 6 years ago

roblourens commented 7 years ago

Testing #31831

I think it's fairly standard for preprocessor directives to be deindented

int foo() {
    int x = 1;
#ifdef BAR
    return x;
#else
    return x+1;
#endif
}

But autoindent will put them at the same indentation level as the other code in the function body.

rebornix commented 6 years ago

For C/C++ indentation rules, let's track it in #36148, where we have comments/feedback from ms-cpp tools team. As at this moment, our indentation rules for c/cpp are not covering most user case and blocking ppl from productive c/cpp authoring, we removed indentation rules from internal c/cpp support. Please leave messages #36148 if you have idea about how to improve it, thanks in advance!