[PATCH] D45069: [clangd] synthesize fix message when the diagnostic doesn't provide one.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 3 04:26:16 PDT 2018


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM with a small nit



================
Comment at: clangd/Diagnostics.cpp:322
+      StringRef Insert = FixIt.CodeToInsert;
+      if (!Invalid && Remove.size() + Insert.size() < 200) {
+        llvm::raw_svector_ostream M(Message);
----------------
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?



Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D45069





More information about the cfe-commits mailing list