IDE_FIND_REFS can also report the definition location
commitcd91c68f481a0eb37a83cb1e4072d90fc83e438e
authorLucian Wischik <ljw@fb.com>
Tue, 4 Apr 2017 17:54:41 +0000 (4 10:54 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 4 Apr 2017 18:00:01 +0000 (4 11:00 -0700)
tree049a2f5e579b520caf23f643a04ec4151433b64d
parent9c8f2118a9d94b0f4bde491764325d89defdca18
IDE_FIND_REFS can also report the definition location

Summary:
Does the definition of "foo" itself count as a reference to the symbol "foo"?

On the one hand, no of course not. On the other hand, when users do FindAllReferences, then despite the name of this action they generally *do* want to see the definition included amongst the list of results. That's the default in VSCode, and it's an option in LSP, and so we should offer it as well.

I'm plumbing through the option. I've only enabled it for LSP clients at the moment (not clientIde.ml since that's going away; not at the command line since I've not heard requests for that).

NOTE: this is my first time adding stuff into the Hack server. It felt like heavy-going. Have I approached this the wrong way?

Reviewed By: arxanas

Differential Revision: D4817275

fbshipit-source-id: c2dc28d063a0fc8a437e7d763dc1cd2d425c615c
hphp/hack/src/client/clientCheck.ml
hphp/hack/src/client/clientIde.ml
hphp/hack/src/client/clientLsp.ml
hphp/hack/src/hh_single_type_check.ml
hphp/hack/src/server/serverCommandTypes.ml
hphp/hack/src/server/serverFindRefs.ml
hphp/hack/src/server/serverFindRefs.mli
hphp/hack/src/server/serverRefactor.ml
hphp/hack/src/server/serverRpc.ml