[PATCH] D93220: [clangd] Add error handling (elog) in code completion.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 15 00:34:01 PST 2020
sammccall added inline comments.
================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:193
+ } else {
+ elog("Code completion header path manipulation failed {0}",
+ HeaderFile.takeError());
----------------
I think this is too noisy.
We can hit this in "normal" cases of certain projects.
For better or worse, we don't currently filter out index results where we know the responsible header and can't include it (because it's not under any include path entry). In these cases toHeaderFile() returns an error.
Since this can happen in the normal case for *each* completion candidate (default 100), and completion requests are very frequent, this could dominate log output in affected projects.
It *might* be OK at vlog? I get the desire to not silence errors here. I think the question is what are the error cases we're *trying* to call out loudly. Maybe we can separate out the "shouldn't happen" vs the "fairly expected" cases.
(Even then there's the prospect that this is either going to not fire or fire dozens of times, which is a little sad)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93220/new/
https://reviews.llvm.org/D93220
More information about the cfe-commits
mailing list