[PATCH] D45069: [clangd] synthesize fix message when the diagnostic doesn't provide one.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 3 10:38:17 PDT 2018
sammccall added inline comments.
================
Comment at: clangd/Diagnostics.cpp:322
+ StringRef Insert = FixIt.CodeToInsert;
+ if (!Invalid && Remove.size() + Insert.size() < 200) {
+ llvm::raw_svector_ostream M(Message);
----------------
ilya-biryukov wrote:
> I don't really see a way out of it, but having a limit is a bit frustrating.
>
> It seems weird to have `change 'foo' to 'bar'`, but `couldn't find 'fsdfsdf'. did you mean 'verylongidentifierthatsumsuptomorethan200'?` for the same error.
> Maybe if the message that clang provides is also very long, use the generated message anyway?
>
Hard to know exactly what to do here without motivating cases. I just removed it.
My reasoning: these diagnostics get printed by clang, if they need a shortened message then the diagnostic should/will provide one as note text.
(An alternative that I tried out was replacing the middle of the text with "..." if it was too long, this worked well but probably isn't worth the extra lines of code)
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45069
More information about the cfe-commits
mailing list