为什么我的 clang 格式不支持 PPDirectiveIndentStyle 选项?

Why does not my clang-format support PPDirectiveIndentStyle option?

本文关键字:PPDirectiveIndentStyle 选项 不支持 格式 我的 clang 为什么      更新时间:2023-10-16

在OSX上安装了最新版本的clang格式:

$ brew upgrade clang-format
Error: clang-format 2018-04-24 already installed
$ clang-format -version
clang-format version 7.0.0 (tags/google/stable/2018-04-24)

并在_clang格式文件中获得了一行来格式化我的C++代码:

PPDirectiveIndentStyle: AfterHash

这会导致这样的错误:

YAML:17:25: error: unknown key 'PPDirectiveIndentStyle'
PPDirectiveIndentStyle: AfterHash

我用谷歌搜索,知道此选项是在 2017.8 [Ref] 中引入的。所以它应该得到支持。我该如何解决这个问题?

终于解决了!密钥应该是IndentPPDirectives.像这些:

IndentPPDirectives: AfterHash
相关文章:
  • 没有找到相关文章