[PATCH] D99540: [clangd] Preserve diags between tweak enumeration and execution

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 7 06:24:21 PDT 2021


sammccall added a comment.

In D99540#2799159 <https://reviews.llvm.org/D99540#2799159>, @kadircet wrote:

>> Sorry I've lost my context - did we decide to move forward with this patch?
>
> I don't think we've came to a conclusion, just decided to postpone until needed. I believe the `cases` design is really a good fit for making tweaks expose multiple code actions.
>
> But we've actually missed one thing while discussing this patch. It actually allows data from `clang::Diagnostic` to be stashed into `clangd::Diag` for use later on. Modules can actually stash this info while the AST is being built, later on they can be retrieved directly from the `ParsedAST::getDiagnostics()`. But this creates the N*M problem again, and feels like a hack.
> What we can do instead is during `enumerateTweak`, we can group `data` in diagnostics (making sure `data` stored in `diagnostic` is keyed by `tweak::id`) and pass an additional array of json objects in `tweak::prepare`.  This will make the problem N+M again and make the data passing explicit.

Sorry, somehow I'm not following this (either the problem or the suggestion at all). Let's chat this week about it...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99540



More information about the cfe-commits mailing list