[PATCH] D38939: [clangd] Handle exit notification (proper shutdown)

Raoul Wols via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 16 11:22:39 PDT 2017


rwols added inline comments.


================
Comment at: test/clangd/authority-less-uri.test:33
 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
+# CHECK: {"jsonrpc":"2.0","id":3,"result":null}
+Content-Length: 33
----------------
sammccall wrote:
> Having the shutdown/exit boilerplate in every test seems unfortunate.
> (I realize this isn't new here, but it's getting worse!)
> 
> Does clangd exit cleanly on stdin EOF? If it could be made to do so, maybe we could just have e.g. the initialize test do the full sequence, and the other tests omit shutdown.
Yeah, we could do that. Just send `{"jsonrpc":"2.0":"method":"exit"}` and don't care about the exit status. Everyone can then omit the `shutdown` request. I have a little more changes coming up for this diff: we should exit with exit status 0 if `shutdown` was received before `exit`, otherwise we should return 1.


https://reviews.llvm.org/D38939





More information about the cfe-commits mailing list