malaperle updated this revision to Diff 140180.
malaperle added a comment.
Use operator<< where we can
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D44764
Files:
clangd/Protocol.cpp
clangd/Protocol.h
unittests/clangd/CodeCompleteTests.cpp
unittests/clangd/JSONExprTests
malaperle added a comment.
In https://reviews.llvm.org/D44764#1046766, @sammccall wrote:
> I understand the template instantiations here are a mess and we need to solve
> the problem. However I'm not sure this is the right direction:
>
> - it violates IWYU, and we expect people consistently to g
ilya-biryukov added a comment.
In https://reviews.llvm.org/D44764#1046766, @sammccall wrote:
>
You raise a good point. If we can get away with using `operator <<` everywhere,
it is definitely the best approach.
Then our rule of thumb is: never define `PrintTo` overload, define `operator
<<` f
sammccall added a comment.
In https://reviews.llvm.org/D44764#1045992, @malaperle wrote:
> In https://reviews.llvm.org/D44764#1045682, @ilya-biryukov wrote:
>
> > In https://reviews.llvm.org/D44764#1045648, @simark wrote:
> >
> > > We could create a file `ClangdTesting.h" which includes everythin
simark accepted this revision.
simark added inline comments.
Comment at: unittests/clangd/Printers.h:12
+// objects on failure. Otherwise, it is possible that there will be two
+// different instantiations of the printer template for a given type and some
+// tests could end up c