++++++++++++++++++++++++++++++++++++++++++++++
UPDATE: There is a clangd VS Code Plugin That works well.
++++++++++++++++++++++++++++++++++++++++++++++

The Clang-Tidy plugin is not being maintained: https://github.com/notskm/vscode-clang-tidy/issues/45

The developer has officially put it on indefinite hiatus.

Also note: You need clang-tidy installed on your system. I did this on my Ubuntu OS using the package manager. sudo apt-get update -y && sudo apt-get install -y clang-tidy.

Answer from Tim on Stack Overflow
🌐
GitHub
github.com › microsoft › vscode-cpptools › issues › 9978
Clang Tidy Code analysis not working with a Workspace file. · Issue #9978 · microsoft/vscode-cpptools
October 9, 2022 - Type: Bug I created a simple project with the following layout: MyProject .vs/settings.json MyProject Sample Sources main.cpp CMakeLists.txt CMakeLists.txt .clang-tidy MyProject.code-workspace I tried moving .clang-tidy around. I tried s...
Author   microsoft
🌐
Microsoft
devblogs.microsoft.com › dev blogs › c++ team blog › visual studio code c++ december 2021 update: clang-tidy
Visual Studio Code C++ December 2021 Update: clang-tidy - C++ Team Blog
December 21, 2021 - These instructions don’t work. My Update Channel is set to Insiders, and my extensions are set to Auto-update. “Check for Extension Updates” says “All extensions are up to date”. But the installed version is 1.7.1, “Install another version” doesn’t list anything newer, and I don’t see any clang-tidy integration. ... Which version of VS Code are you using? You can check by opening VS Code and selecting Help > Release notes.
🌐
Reddit
reddit.com › r/cpp › clang-tidy support in vscode is possible
r/cpp on Reddit: clang-tidy support in VSCode is possible
October 21, 2020 -

if you're an exceptionally attractive individual like me, the only things preventing you from retiring clion and adopting vscode (for everything) are clang-tidy and cppcheck. we can get clang-tidy by upvoting this feature request for adding clang-tidy support to the cpp extension for vscode: https://github.com/microsoft/vscode-cpptools/issues/2908

clang-tidy good. more clang-tidy.

🌐
GitHub
github.com › clangd › clangd › issues › 1727
`clangd` can't detect some `clang-tidy` problems · Issue #1727 · clangd/clangd
August 13, 2023 - Hey there! I am using clangd on Visual Studio Code. Before creating .clang-tidy file, no problems were detected in my code which is the expected behavior. I created a .clang-tidy file using the output from clang-tidy -dump-config and now...
Author   clangd
🌐
GitHub
github.com › microsoft › vscode-cpptools › issues › 8952
Codeanalysis with clang-tidy fails when run from VSCode but not from commandline · Issue #8952 · microsoft/vscode-cpptools
March 1, 2022 - I'm only guessing, but for me it seems that the cpp extension does not pass the correct command line arguments from the compile_commands.json to clang-tidy after the --. Since the brew version of clang-tidy seems to work. I would love to share all logs etc.
Author   microsoft
🌐
Reddit
reddit.com › r/vscode › c++23 -- clang-tidy-diagnostics errors
r/vscode on Reddit: C++23 -- Clang-tidy-diagnostics errors
September 23, 2024 -

Edit: After pasting C++23 everywhere i could even think about I finaly got it running through editing `.code-workspace` with:

        "C_Cpp.codeAnalysis.clangTidy.enabled": true,
        "C_Cpp.codeAnalysis.clangTidy.path": "C:\\msys64\\ucrt64\\bin\\clang-tidy.exe",
        "C_Cpp.codeAnalysis.clangTidy.args": [
            "-std=c++23"
        ]
###

I tried switching up my workspace to C++23 (from C++17) but I run into constant erros by clang-tidy. I use g++ 14.2.0 as compiler so by my understanding there should be c++23 support. Any help appreciated. I'm quite new with C++ (or compiler languages in general) so i excuse for a lack of understanding on my side.

Errors densed down for readability. (clang etc in the comments)

[{
"owner": "clang-tidy",
"code": "clang-diagnostic-error",
"relatedInformation": [
{
"message": "use of undeclared identifier '_Float32'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/bits/cpp_type_traits.h"
},
{
"message": "use of undeclared identifier '_Float64'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/bits/cpp_type_traits.h"
},
{
"message": "use of undeclared identifier '_Float128'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/bits/cpp_type_traits.h"
},
{
"message": "no member named '__bfloat16_t' in namespace '__gnu_cxx'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/bits/cpp_type_traits.h"
},
{
"message": "invalid suffix 'bf16' on floating constant",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/compare"
},
{
"message": "use of undeclared identifier '_Float32'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/ext/type_traits.h"
},
{
"message": "use of undeclared identifier '_Float64'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/ext/type_traits.h"
},
{
"message": "use of undeclared identifier '_Float128'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/ext/type_traits.h"
},
{
"message": "no member named '__bfloat16_t' in namespace '__gnu_cxx'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/ext/type_traits.h"
},
{
"message": "unknown type name '_Float32'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/numbers"
},
{
"message": "use of undeclared identifier '_Float32'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/numbers"
},
{
"message": "use of undeclared identifier '_Float32'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/type_traits"
},
{
"message": "use of undeclared identifier '_Float64'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/type_traits"
},
{
"message": "use of undeclared identifier '_Float128'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/type_traits"
},
{
"message": "no member named '__bfloat16_t' in namespace '__gnu_cxx'",
"resource": "/c:/msys64/ucrt64/include/c++/14.2.0/type_traits"
}
]
}]
🌐
GitHub
github.com › microsoft › vscode-cpptools › issues › 12853
Clang-tidy works incorrectly · Issue #12853 · microsoft/vscode-cpptools
October 18, 2024 - Clang-tidy does not work when i use custom configuration file .clang-tidy. However, when i set C_Cpp > Code Analysis > Clang Tidy > Checks: Disable/Enable in C/C++ extension settings file, it works correctly. I will attach some screensho...
Author   microsoft
Find elsewhere
🌐
GitHub
github.com › clangd › vscode-clangd › issues › 616
clang-tidy's functionality not works with clangd version 18 · Issue #616 · clangd/vscode-clangd
Under std::endl, clang-tidy prompt you: Do not use 'std::endl' with streams; use '\n' instead (fix available)clang-tidy performance-avoid-endl
Author   clangd
🌐
Microsoft Learn
learn.microsoft.com › en-us › shows › pure-virtual-cpp-2022 › clang-tidy-in-visual-studio-code
clang-tidy in Visual Studio Code | Microsoft Learn
April 20, 2022 - clang-tidy is an extensible C++ linter which can be used to find issues in your code and to enforce style rules in your codebase. Find out how you can leverage it from within Visual Studio Code. Recommended resources Visual Studio Code C++ December 2021 Update: clang-tidy
🌐
GitHub
github.com › microsoft › vscode-cpptools › issues › 10375
Clang-tidy integration not working with CUDA files and Failing to run at all if args are provided · Issue #10375 · microsoft/vscode-cpptools
January 16, 2023 - Code Analysis via clang-tidy produces erroneous errors when checking .cu files and fails to run at all if passed any args.
Author   microsoft
🌐
GitHub
github.com › openblack › openblack › wiki › Getting-clang‐tidy-working-on-Windows-with-VSCode
Getting clang‐tidy working on Windows with VSCode
August 31, 2024 - If it doesn't, try making a clang-tidy violation such as removing & from a auto& or adding a comment with only // TODO, then press F1 and restart the clangd server. Once it's done indexing, you will see violations highlighted in vscode.
Author   openblack
🌐
Reddit
reddit.com › r/cpp › vs code - clang-tidy support in c/c++ extension
r/cpp on Reddit: VS Code - clang-tidy support in C/C++ extension
December 14, 2021 - Or you can use https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd ;-) ... If there are certain workspace files or folders that you don’t want to run clang-tidy on, add them to the Clang Tidy: Exclude setting (C_Cpp.codeAnalysis.exclude in settings.json).
🌐
ESP32 Forum
esp32.com › viewtopic.php
Can't get esp-clang (clang-tidy) to work with Code Analysis Mode of VS Code C/C++ extension - ESP32 Forum
Error while processing ... ... /issues/36 - https://github.com/espressif/esp-idf/issues/6868 I tried to install the IDF Tool "Clang-Tidy" or esp-tidy, was not able to properly attach it to the C/C++ extension....
🌐
YouTube
youtube.com › microsoft developer
clang-tidy in Visual Studio Code - YouTube
Sign up for Pure Virtual C++ 2022, a free one-day virtual conference for the whole C++ community running on April 26th: https://aka.ms/pure-virtual-cppclang-...
Published   April 21, 2022
Views   19K
🌐
Reddit
reddit.com › r/cpp_questions › vscode & clang-tidy and other tools
r/cpp_questions on Reddit: VScode & clang-tidy and other tools
November 9, 2024 -

Hello,

I am working through various complaints from clang-tidy, clang and cppcheck. I have a couple questions with a Vulkan CMake project . I am having a bit of time setting everything properly. Note everything builds with Cmake.

  1. with Clang-tidy I know of the .clang-tidy file in project root directory. But I am not understanding how to let clang-tidy know of the Include paths. It is finding the Vulkan header files though I at this point I am not certain how. However it is not finding GLFW/glfw3.h header files. I am at a loss of how to proceed. CoPilot mentions compile_commands.json but creating one has not solved my problem.

  2. flylint has a number of settings including for includePaths. The questions will clang and cppcheck inherit the includePaths setting from the flylint.includePaths variable or do I have to set those all separately . Of course this course if inheritance should apply to a number of other flylint variables.

Thanks,

Frank

🌐
GitHub
github.com › microsoft › vscode-cpptools › issues › 9352
Clang-Tidy: Not clear when it's running or not · Issue #9352 · microsoft/vscode-cpptools
May 23, 2022 - Feature Request I'm not sure if this is a bug or not. Sometimes, quite often it is not clear if Clang-Tidy is running or experiencing a problem. Especially in automatic mode. Maybe it is taking a lot of time for the Clang-Tidy check to f...
Author   microsoft