[PATCH] D62372: [clangd] Limit the size of synthesized fix message
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 24 02:59:10 PDT 2019
kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.
LGTM, thanks!
================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:449
+
+ size_t FirstNewline = R.find('\n');
+ if (FirstNewline != llvm::StringRef::npos)
----------------
or maybe just `R = Code.split('\n').first` ?
================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:452
+ R = R.take_front(FirstNewline);
+ if (R.size() > MaxLen)
+ R = R.take_front(MaxLen);
----------------
no need for the check, already performed in take_front.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62372/new/
https://reviews.llvm.org/D62372
More information about the cfe-commits
mailing list