vscode clang-tidy squiggling< iostream>标题是因为“ __ float128不支持此目标”。

发布于 2025-01-26 15:55:22 字数 1551 浏览 1 评论 0原文

此视频,Microsoft中C/C ++扩展中提供的C ++ linter(Clang) -tidy)在Vscode中散布标准库的标题,产生了不可回复的问题。

但是,除了这一事实之外,林格在视频中被删除后被弄清并清理自身的双重陈述所证明的那样。

我已经尝试了许多解决方案:

使用// NOLINT(及其派生如// NOLINTNEXTLINE),如 clang-tidy文档。这不会改变任何东西。

#include <iostream> // NOLINT

使用- header_filter =参数,以下表格完全打破了覆盖:

"C_Cpp.codeAnalysis.clangTidy.headerFilter": "^((?!std_abs\\.h|stl_algobase\\.h|type_traits).)*$",
"C_Cpp.codeAnalysis.clangTidy.args": [
    "--header_filter='^((?!std_abs\\.h|stl_algobase\\.h|type_traits).)*$'"
],

这不起作用,因为posix ere不支持负面lookahead,并且应该指定标题过滤器,不是要忽略的。 我还尝试匹配有问题的文件,即使该文档指定了完全相反的文件,这也打破了绒毛。

使用- line-filter来滤除线路,这也打破了覆盖:

"C_Cpp.codeAnalysis.clangTidy.args": [
        "--line-filter=[{\"name\":\"vscode_main.cpp\", \"lines\": [[1,1]]}]"
],

我也尝试了相反的版本,无用:

"C_Cpp.codeAnalysis.clangTidy.args": [
        "--line-filter=[{\"name\":\"vscode_main.cpp\", \"lines\": [[2,1000]]}]"
],

总而言之。如果有人对问题有任何解决方案或建议,并且可以发布问题,我会很高兴。

As seen in this video, the C++ Linter provided in the C/C++ extension from Microsoft (clang-tidy) in VSCode squiggles the header of the standard library, producing an irresolvable problem.

However, outside of this fact, the linter works as expected, as demonstrated by the double-declaration being squiggled and clearing itself after being removed in the video.

I have tried many solutions to this problem:

Using // NOLINT (and its derivates such as //NOLINTNEXTLINE) as described in the clang-tidy documentation. This does not change anything.

#include <iostream> // NOLINT

Using the --header_filter= argument, in the following forms, which completely broke the linting:

"C_Cpp.codeAnalysis.clangTidy.headerFilter": "^((?!std_abs\\.h|stl_algobase\\.h|type_traits).)*
quot;,
"C_Cpp.codeAnalysis.clangTidy.args": [
    "--header_filter='^((?!std_abs\\.h|stl_algobase\\.h|type_traits).)*

This does not work as Posix ERE does not support negative lookahead and the header filter is supposed to specify which ones to check, not which ones to ignore.
I also tried matching the offending files, even though the documentation specifies the exact opposite, which also broke the linting.

Using --line-filter to filter the line out, which also broke the linting:

"C_Cpp.codeAnalysis.clangTidy.args": [
        "--line-filter=[{\"name\":\"vscode_main.cpp\", \"lines\": [[1,1]]}]"
],

I also tried the opposite version of that, to no avail:

"C_Cpp.codeAnalysis.clangTidy.args": [
        "--line-filter=[{\"name\":\"vscode_main.cpp\", \"lines\": [[2,1000]]}]"
],

In conclusion, my attempts either did nothing or broke linting completely. If anyone has any solutions to or suggestions regarding the problem and could post them, I'd be glad.

" ],

This does not work as Posix ERE does not support negative lookahead and the header filter is supposed to specify which ones to check, not which ones to ignore.
I also tried matching the offending files, even though the documentation specifies the exact opposite, which also broke the linting.

Using --line-filter to filter the line out, which also broke the linting:

I also tried the opposite version of that, to no avail:

In conclusion, my attempts either did nothing or broke linting completely. If anyone has any solutions to or suggestions regarding the problem and could post them, I'd be glad.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文