This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE319159: [clangd] Switch from YAMLParser to JSONExpr
(authored by sammccall).
Changed prior to commit:
https://reviews.llvm.org/D40406?vs=124163&id=124529#toc
Repository:
rCTE Clang Tools Extra
htt
ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.
lg
https://reviews.llvm.org/D40406
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
sammccall added inline comments.
Comment at: clangd/JSONRPCDispatcher.h:47
+ // Whether output should be pretty-printed.
+ const bool Pretty;
+
ioeric wrote:
> It seems that we are piggybacking a state of clangd with `JSONOutput`. It
> might make sense to stor
sammccall updated this revision to Diff 124163.
sammccall marked an inline comment as done.
sammccall added a comment.
Herald added a subscriber: ilya-biryukov.
Use llvm::toString
https://reviews.llvm.org/D40406
Files:
clangd/ClangdLSPServer.cpp
clangd/JSONExpr.h
clangd/JSONRPCDispatcher.
ioeric added inline comments.
Comment at: clangd/JSONRPCDispatcher.cpp:221
+Out.log("<-- " + JSONRef + "\n");
+handleAllErrors(Doc.takeError(), [&](const llvm::ErrorInfoBase &Err) {
+ Out.log(llvm::Twine("JSON parse error: ") + Err.message() + "\n");
sammccall edited reviewers, added: ioeric; removed: ilya-biryukov.
sammccall added a comment.
Oops, Eric is most likely to have this stuff in cache :-)
Sorry this is huge and ugly, -500 lines though!
I think the `Protocol` code could be a lot tighter (there's still a lot of
repeated "is this an
sammccall created this revision.
- Converted Protocol.h parse() functions to take JSON::Expr. These no longer
detect and log unknown fields, as this is not that useful and no longer free. I
haven't changed the error handling too much: fields that were treated as
optional before are still option