-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement enhanced integration with clang-tidy #2908
Comments
We support clang-format already. Other VS Code extensions might exist that use the other clang tools. |
Ugh. They don't. |
Here's another vote for clang-tidy |
And another vote for clang-tidy |
There's an extension for clang-tidy (https://marketplace.visualstudio.com/items?itemName=alesiong.clang-tidy-linter) but apparently it's incomplete (some TODOs) and discontinued (last update about year ago). So, what's the decision for supporting linting in vscode-cpptools? Is it on the roadmap or should we rely on other extensions? |
@tehKaiN It's not on our extension's roadmap currently. |
It looks like Visual Studio has added support for clang-tidy: https://devblogs.microsoft.com/cppblog/code-analysis-with-clang-tidy-in-visual-studio/ ...but VS doesn't run on Mac/Linux. |
I still think that clang-tidy support should be added as a first-party feature, but it looks like progress has been made in this space. I'm happily using the following extension: https://marketplace.visualstudio.com/items?itemName=notskm.clang-tidy |
Yes, it would be nice to have because using it as a separate extension (https://github.com/notskm/vscode-clang-tidy for example) is incredibly slow. https://github.com/clangd/vscode-clangd have support for |
I believe it makes sense for Microsoft to start looking at this. The only real alternative will no longer be maintained. |
This feature request has received enough votes to be added to our backlog. |
is the thumbs up reaction enough? bc i'd like to cast a vote for this feature. clang-tidy and cppcheck are the only reasons i still use clion, but i would much rather use vscode |
PLease! |
Yeah, and it also has some issues with remote workspaces and is lacking features that would make vscode shine like using CodeActionKind so clang tidy fixes can be applied nicely in the UI. I think clang-tidy fits in line with the cpptools including clang-format support and I'm hopeful a cpptools implementation would use all some of the cool vscode features :) |
I simply don't understand why they don't understand the importance of Clang-tidy. It is as important as C/C++ for Visual Studio Code or Clangd to me. Clang-tidy is the only reason I'm not switching to VS Code. |
@mh0s41n This is currently the 5th highest voted feature request, so it seems like it's important to me. Our current focus for 1.2 is on improving stability, testing, and C++20 IntelliSense issues. I'm not sure yet what the feature roadmap is after that. |
Didn't even know this was upvoted. |
Moving this to "On Deck." This feature may need to be split into smaller ones as we might not be able to do all the tools in a single release. |
Great news, |
I don't have an ETA yet, but if you see this issue moved to a particular milestone then that milestone will usually have a target release date. We're about to release 1.2.0 in a few days and 1.3.0 is expected to last 6 weeks or so, but I don't think this issue will make that milestone, so it would be 1.4.0 or later, which could be 3 months. |
Isnt clangd the official extension from LLVM team ? If that so, I wish cooperation between Microsoft and LLVM for compatibility between the two extensions. Reinventing the wheel may not be a good option in every case. |
It's great that it's happening. But what about CMake support? Even about VS I could only find how to enable it via CMakeSettings.json and nothing about configuration via presets. |
@Zingam It works with CMake Tools as the configuration provider, i.e. it just hooks into whatever configuration is being used for IntelliSense. We won't have "run on build" for V1, but "Run Code Analysis on All Files" should be exactly the same if you have the configuration provider or compile commands set. Was there additional CMake support you wanted? |
@sean-mcmanus I was thinking in the context of CMakePresets something like the settings in CMakeSettings.json https://docs.microsoft.com/en-us/cpp/code-quality/clang-tidy?view=msvc-170 It maybe more of a case for the CMake extension. Thank you for your work! I really appreciate it. |
@Zingam You should be able to enforce the clang-tidy rules with a checked in .clang-tidy file. But if you want to exclude certain folders from being processed (i.e. due to the code not yet conforming to the .clang-tidy rules or owned by other teams), then you'll also need to check in a .vscode/settings.json with |
@sean-mcmanus I tested the feature in the insider version, and it works seamlessly. Thanks a lot to you and the team for implementing this! |
yeah, thank you @sean-mcmanus and cpptools team for fantastic works . I had been waiting for a long long time. |
This is now available for "preview" in 1.8.0-insiders: https://github.com/microsoft/vscode-cpptools/releases/tag/1.8.0-insiders . There are some known bugs we're working on fixing still for 1.8.0 (e.g. saving of headers may fail if clang-tidy is processing the header as part of a TU that is different from the "default" TU chosen by IntelliSense). And the clang-tidy quick fixes are postponed till the next release. |
+1 for "And the clang-tidy quick fixes are postponed till the next release." - for the quick fixes, not the postponing. |
Implement support for clang extra tools.
EDIT: This issue will just cover clang-tidy. The remaining tools are covered by issue #7276
The text was updated successfully, but these errors were encountered: