You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何禁用clang-format自动添加命名空间闭合注释?

关闭clang-format命名空间闭合处自动添加注释的方法

你只需在现有配置中添加一行NamespaceComment: false,即可关闭命名空间闭合处自动添加注释的功能。

修改后的完整配置如下:

BasedOnStyle: LLVM,
UseTab: Never,
IndentWidth: 2,
TabWidth: 2,
BreakBeforeBraces: Attach,
AllowShortIfStatementsOnASingleLine: true,
IndentCaseLabels: false,
ColumnLimit: 0,
AccessModifierOffset: -2,
NamespaceComment: false

该选项会禁用clang-format在命名空间结束的花括号后自动追加// namespace XXX注释的行为,完全匹配你的需求。

内容的提问来源于stack exchange,提问作者Rodrigo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.06 04:57:02