[PATCH] D133757: [clangd] Perform system include extraction inside CommandMangler

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 1 01:40:07 PDT 2022


nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/test/system-include-extractor.test:82
+
+# Skip past the lack of diagnostics in the workspace and user config files...
+# CHECK2:   "method": "textDocument/publishDiagnostics",
----------------
nridge wrote:
> Ugh, this doesn't quite work in that whether we get diagnostics for the **user** config file depends on whether it exists. It happens to on my system but presumably it may not on a buildbot?
> 
> Should I create a user config file in the lit test so it reliably exists (and delete it at the end)? Or is there some FileCheck magic I can employ that would ignore an optional second publishDiagnostics which is not the interesting one?
Ok, I figured out a way to handle this properly:

 * I included clangd's stderr in the FileCheck input so we could match lines from stderr like "ASTWorker building file"
 * By first looking for "ASTWorker building file" and then the next publishDiagnostics, we can be sure that the diagnostics pertain to the source file and not a config file


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133757



More information about the cfe-commits mailing list