是否有一些方法可以更改 Qt Creator 语法突出显示的设置?

Sun*_*nny 5 c++ syntax qt qt-creator

我在 Ubuntu 18.10 中使用基于 Qt 5.11.1 的 Qt Creator 4.6.2 使用文件中的CONFIG += console c++17密钥进行 C++ 编程,.pro我遇到了以下代码的问题:

std::for_each(attributes.begin(), attributes.end(), [&,i{0}](auto it) mutable {compressed.col_id[i] = it.first; i++;});
Run Code Online (Sandbox Code Playgroud)

Qt Creator 用红色强调了这段代码并说“预期的令牌';' 得到 '{'" 但编译器运行此代码没有问题。同样,当我尝试运行此代码时:

int i = 0;
std::for_each(attributes.begin(), attributes.end(), [&](auto it) mutable {compressed.col_id[i] = it.first; i++;});
Run Code Online (Sandbox Code Playgroud)

Qt Creator 没有下划线。

我认为在 IDE 中解析可能存在一些问题,那么我该如何处理呢?

yus*_*suf 4

尝试使用 C++ 的 ClangCodeModel。它在您的版本中可能是实验性的,但我\xc2\xb4ve也在那里使用过它。不过可能会很慢。

\n\n

Clang 代码模型

\n