support cancellation of requests from LSP
commit882146afef685fd26c39c6feb506611d1443f7b5
authorLucian Wischik <ljw@fb.com>
Tue, 13 Jun 2017 13:49:54 +0000 (13 06:49 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 13 Jun 2017 14:04:37 +0000 (13 07:04 -0700)
tree8b74b27dadba6b62da22a97d941e0cb0b15f4ad7
parent53d8ca60b43517b22e1483834636cc8818171d5e
support cancellation of requests from LSP

Summary:
We're familiar with requests from the client to LSP.

LSP can also issue requests, e.g. to show a dialog to the user and get a response back when the user clicks a button.

JsonRPC says that the sender of a request can cancel it while it's underway. It's clear how that should behave when the client made a request of the LSP server and wants to cancel it.

But what should happen when the LSP server makes a dialog-request and later cancels it? -- I think it should dismiss the dialog, and that will indeed support a nicer user experience. (VSCode does nothing; it ignores the cancellation).

This diff adds the basic support for cancellation.

Reviewed By: arxanas

Differential Revision: D5220791

fbshipit-source-id: 2d231b4d76db9acd6d0bc7a90aa6f734596ffb05
hphp/hack/src/client/clientLsp.ml