Unified symbol-to-docblock server command
commit08b49aeea4b2e200106c13bbbbe396e5b18defa8
authorTed Spence <tspence@fb.com>
Fri, 21 Jun 2019 16:30:55 +0000 (21 09:30 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Fri, 21 Jun 2019 16:39:26 +0000 (21 09:39 -0700)
treec3a4427f135a5454f291c504bd997372bedc29e5
parent064f923a7cd0c263cb385326fd2dd08c63213344
Unified symbol-to-docblock server command

Summary:
The "completion/resolve" command required two separate roundtrips to the server to calculate a docblock.  That's a little bit wasteful.  Let's do it with one roundtrip instead.

Previously, we used LOCATE_SYMBOL followed by DOCBLOCK_AT.  Now we'll just use a single command, DOCBLOCK_FOR_SYMBOL.

While working on this I also noticed that the documentation for the "data" element in LSP completion / resolve says that the value is only intended to be used as output from textDocument/completion for processing in completion/Resolve.  Therefore, we no longer need to do fixup on that value when it comes out of completion/Resolve.

Reviewed By: pittsw, arxanas

Differential Revision: D15910822

fbshipit-source-id: 497f5ae866efbd30f51d29beefc6dbe75ea29f12
hphp/hack/src/client/clientLsp.ml
hphp/hack/src/server/serverCommand.ml
hphp/hack/src/server/serverCommandTypes.ml
hphp/hack/src/server/serverCommandTypesUtils.ml
hphp/hack/src/server/serverDocblockAt.ml
hphp/hack/src/server/serverDocblockAt.mli
hphp/hack/src/server/serverRpc.ml
hphp/hack/test/integration/data/lsp_exchanges/completion.expected
hphp/hack/test/integration/data/lsp_exchanges/completion_legacy.expected