hokein added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp:170-175
+    diag(Inc.SymRefLocation, "missing include %0")
+        << Inc.MissingHeaderSpelling
+        << FixItHint::CreateInsertion(
+               SM->getComposedLoc(SM->getMainFileID(),
+                                  Replacement->getOffset()),
+               Replacement->getReplacementText());
----------------
PiotrZSL wrote:
> Use IncludeInserter::createIncludeInsertion if possible...
> So include style would be properly handled.
`tooling::HeaderIncludes` already handles the include style well (and more). In 
general,  we recommend to use `tooling::headerIncludes` --  it was built for 
generic toolings that need to perform #include manipulations, it has been 
heavily used in clangd/clang-format/clang-include-cleaner etc.

`IncludeInserter::createIncludeInsertion` is an old implementation in 
clang-tidy, and it was built before `tooling::HeaderIncludes` is thing.  In the 
long-term, I think we should probably consider deprecating it and replacing it 
with `tooling::HeaderIncludes`.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148793/new/

https://reviews.llvm.org/D148793

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to