notskm / vscode-clang-tidy

MIT License
48 stars 26 forks source link

[feature_request] Add clang-tidy to C++ formatters list #72

Closed rickstaa closed 3 years ago

rickstaa commented 3 years ago

It would be very nice if clang-tidy would be recognized as a C++ formater by vscode. The "clang-tidy.fixOnSave": true is already very helpful however I think it would make more sense to remove this option and add clang-tidy as a C++ formatter. By doing this people can register clang-tidy as their C++ formatter such that it can format the code when a document is saved (i.e. "editor.formatOnSave": true is enabled).

clang-tidy-problem

notskm commented 3 years ago

I disagree. The issue is that clang-tidy is not a formatter, but rather a linter. A formatter makes your code look pretty without changing its semantics. A linter provides warnings and suggestions for refactoring. The appropriate mechanism for applying refactoring suggestions is the code actions API. This would make the suggestions available as quick fixes.

The quick fix functionality is available in the master branch, but it has not been released. If I recall, there were some issues I wanted to fix before I released it. Unfortunately, I haven't had the time due to school and other obligations.

rickstaa commented 3 years ago

@notskm No problem I understand. Just a heads-up I think clang-tidy will be integrated into the vscode-cpptools extension soon (see https://github.com/microsoft/vscode-cpptools/projects/23#card-71165882).