don't error on registerCapability
commit81f4c3ca4f7190c350840266ae380efc8edb304d
authorLucian Wischik <ljw@fb.com>
Fri, 24 Jan 2020 00:31:38 +0000 (23 16:31 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 24 Jan 2020 00:40:23 +0000 (23 16:40 -0800)
tree347e75ae5d4ae69c26a21500eda7555c034554df
parentacaf318f4a7495a5b30c6ae4aa337b3151865dc0
don't error on registerCapability

Summary:
We send a client/registerCapability request, to ask for file change notifications.

The client sends back a response.

But we never got around to coding anything to parse that response. Consequently, we report an error that looks scary in the logs:
```
[Trace - 9:38:41 PM] Received request 'telemetry/event - (10000000000004)'
Result: {
  "jsonrpc": "2.0",
  "method": "telemetry/event",
  "params": {
    "type": 1,
    "message": "Lsp.Error.Parse(\"Don't know how to parse LSP response client/registerCapability\"), from_client\nRaised at file \"/data/users/ljw/fbsource/fbcode/hphp/hack/src/utils/lsp/lsp_fmt.ml\", line 1358..."
  }
}
```

This diff adds ability to parse the response (which has empty content) so as to avoid the scary log messages.

Reviewed By: arxanas

Differential Revision: D19531019

fbshipit-source-id: a81da97f0f497806903a9e1a1520b03059ffa32a
hphp/hack/src/client/clientLsp.ml
hphp/hack/src/utils/lsp/lsp.ml
hphp/hack/src/utils/lsp/lsp.mli
hphp/hack/src/utils/lsp/lsp_fmt.ml