[PATCH] D149437: [clangd] Emit ChangeAnnotation label and description for include-cleaner diagnostics.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 4 00:53:14 PDT 2023


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/IncludeCleaner.cpp:550
   std::optional<Fix> FixAll;
   if (RemoveAllUnused && AddAllMissing)
     FixAll = fixAll(*RemoveAllUnused, *AddAllMissing);
----------------
kadircet wrote:
> sorry for missing it during last review, but this should actually be `if (!UnusedIncludes.empty() && !MissingIncludeDiags.empty())` as even if we have only 1 fix for each category, we should still show the fix all. probably it deserves a fix in a separate patch.
good catch, send a fix in https://reviews.llvm.org/D149822. (it turns out more tricky than we thought, only changing the if is not enough, I added some unittests for it).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149437



More information about the cfe-commits mailing list