c++ - How to stop VS Code from wrongly indenting top level namespaces? - Stack Overflow

My clang_format mandates the following behavior:namespace test{namespace inner{int test;int test2;}

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743748615a4500478.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信