use rpc instead of notify
commit2dbaa14e12732f4208f955639725f145ec7d89ea
authorLucian Wischik <ljw@fb.com>
Thu, 16 Apr 2020 20:21:26 +0000 (16 13:21 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 16 Apr 2020 20:39:43 +0000 (16 13:39 -0700)
tree61385936b1b1a5cfecf29588408a9b773ef744bb
parenta80ab6e226c2b0f971350b0453a5566b53bfdd59
use rpc instead of notify

Summary:
My goal is that, for every message we send to clientIdeDaemon, we should record telemetry for it - did it succeed? how long did it take?

That was already happening fine for requests to IdeDaemon. But it wasn't happening for notifications (disk-file-changed, ide-file-opened etc). That's because for these notifications, (1) clientLsp merely stuck them on an outgoing queue for ClientIdeDaemon to pick up at some time in the future, (2) clientIdeDaemon never responded. Or rather, it normally didn't respond, but if an exception arose then it would respond, leading to desync. (Note: we have no suspicion that any notifications ever gave rise to exceptions and desyncs).

Anyway, with this diff, I've abandoned the "notify" mechanism. Instead, every notification from clientLsp goes through the standard ClientIdeService.rpc mechanism.

Reviewed By: arxanas

Differential Revision: D21036286

fbshipit-source-id: d8da14e8a9d654bdbf1dc3329d543ed103303e60
hphp/hack/src/client/clientLsp.ml
hphp/hack/src/client/ide_service/clientIdeDaemon.ml
hphp/hack/src/client/ide_service/clientIdeMessage.ml
hphp/hack/src/client/ide_service/clientIdeService.ml
hphp/hack/src/client/ide_service/clientIdeService.mli
hphp/hack/src/utils/lsp/lsp_fmt.ml
hphp/hack/src/utils/lsp/lsp_fmt.mli