[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. sammccall marked 5 inline comments as done. Closed by commit rL344620: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (authored by sammccall, committed by ). Herald added a subscriber:

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clangd/JSONRPCDispatcher.h:70 /// A handler responds to requests for a particular method name. + /// It returns true if the server should now shut down.

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 9 inline comments as done. sammccall added inline comments. Comment at: clangd/ClangdLSPServer.cpp:156 +void ClangdLSPServer::onExit(ExitParams ) { + // XXX handler should return true. +} ioeric wrote: > ? Fixed this comment. I'm not totally

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 169835. sammccall marked 9 inline comments as done. sammccall added a comment. Addressed review comments. Also inverted the sense of the boolean return from `onNotify` etc, was "should exit" and is now "should continue", which I think is slightly clearer.

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Nice! The code looks much clearer. Just some nits Comment at: clangd/ClangdLSPServer.cpp:156 +void ClangdLSPServer::onExit(ExitParams ) { + // XXX handler should return true. +} ? Comment at:

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 169807. sammccall added a comment. Add unit test for JSON transport. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53286 Files: clangd/CMakeLists.txt clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-15 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. For reference, @jkorous has a WIP in https://reviews.llvm.org/D53290. It's scope is a superset, and I think everything in common is basically the same (they were both based on a common prototype). Jan is out at the moment, so I think it makes sense to move ahead with

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-15 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This patch is big and hard to navigate. I tried to keep it contained, but JSONRPCDispatcher is pretty tangled. The main parts are: - `Transport.h` is the key new abstraction that should be understood first - `JSONTransport.cpp` is its standard implementation. The raw

[PATCH] D53286: [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction.

2018-10-15 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added reviewers: jkorous, ioeric, hokein. Herald added subscribers: cfe-commits, kadircet, arphaman, MaskRay, ilya-biryukov, mgorny. This paves the way for alternative transports (mac XPC, maybe messagepack?), and also generally improves layering: