strongly type respond_jsonrpc
commitabeb37c08af9ca413105753b7fe316a451bfc878
authorLucian Wischik <ljw@fb.com>
Tue, 10 Dec 2019 04:56:27 +0000 (9 20:56 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 10 Dec 2019 05:02:51 +0000 (9 21:02 -0800)
tree4f07b27189f82a09428a6d596af05db310ea32ce
parentbc75755ced8e5226e9a7908bbfe96e9772ff773b
strongly type respond_jsonrpc

Summary:
My goal is to have a single canonical parse of the incoming jsonrpc into a strongly-typed ocaml ADT, so the rest of the code only uses that ADT.

One part of this is the `jsonrpc.id` field. We need to know the ID of the incoming jsonrpc request so we can issue a correct response.

Prior to this diff, the "respond" method used the ID from the untyped jsonrpc. After this diff, it uses the ID from the strongly-typed ADT.

(This is an incremental step towards getting rid of the untyped jsonrpc).

Note: there were two spots where clientLsp was failing to provide the `powered_by=Serverless_IDE` message but should have done. I updated those, and updated the tests accordingly.

Reviewed By: arxanas

Differential Revision: D18875005

fbshipit-source-id: e0c8eb0528a91b9e88dcd347670fd9f988aba431
hphp/hack/src/client/clientLsp.ml
hphp/hack/test/integration/test_lsp.py