admin管理员组

文章数量:1344546

My clang_format mandates the following behavior:


namespace test
{
namespace inner
{
    int test;
    int test2;

}  // namespace inner
namespace small
{
}
class MockSerializeWriter
{
};
}  // namespace test

Via this config:

BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 120
AlignConsecutiveAssignments: true
BreakBeforeBraces: Allman
NamespaceIndentation: Inner
FixNamespaceComments: true
ShortNamespaceLines: 2

However, when I press enter after namespace test {, a new line is added. When I paste code in it, it is indented.

I want that to stop. I tried disabling it in settings, no effect:

It's just a little thing, but it's so annoying when creating many smaller components.

本文标签: cHow to stop VS Code from wrongly indenting top level namespacesStack Overflow