Add document highlight to serverless IDE
commit1850ed79acb7ecb9d2ef91987ff3f646671019fd
authorTed Spence <tspence@fb.com>
Mon, 22 Jul 2019 18:53:07 +0000 (22 11:53 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 22 Jul 2019 19:03:52 +0000 (22 12:03 -0700)
treedc19d70e6608a9c6abb5baf10806fc558f6deb5d
parentd599ff943a52d257b9d08339b349354d85692d65
Add document highlight to serverless IDE

Summary:
Add the ability for serverless IDE to respond to document highlight requests.

This diff enables serverless IDE to respond to `document/highlight` LSP requests, which ... aren't tremendously useful.  They take the form of a very faint grey highlight that occurs when you single click on a variable or class name.  You can get much more rapid results by double-clicking, which identifies all matching strings in the file and doesn't require a language server.
 The grey highlights are so subtle as to be almost unnoticeable.

Currently, the performance of anything that calls `ServerIdeContext.update` is not great.  This diff exposes that problem since it has to recheck the file in order to find references properly.  From conversation with Waleed Khan we will tackle that performance issue separately.

Given the low experiential value of document highlight, we reserve the option to disable it if that results in a better experience.

Reviewed By: arxanas

Differential Revision: D16382381

fbshipit-source-id: 98d487e2c4b1e57eb9b7c77d0a3e659d95db4680
hphp/hack/src/client/clientIdeMessage.ml
hphp/hack/src/client/clientLsp.ml
hphp/hack/src/server/serverHighlightRefs.ml
hphp/hack/src/server/serverHighlightRefs.mli
hphp/hack/src/stubs/clientIdeService.ml