Thread `Provider_context.t` through `ServerFindLocals`
commit85b08f978704caabd3990ec86656c54d35aa6029
authorWaleed Khan <waleedk@fb.com>
Wed, 18 Mar 2020 23:33:42 +0000 (18 16:33 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 18 Mar 2020 23:37:47 +0000 (18 16:37 -0700)
tree49dcf5575782fbd4f2c0b0a1a96df2acb2a07636
parent3629f1ef8357cdd31fd563c0b540a7fab9fa2756
Thread `Provider_context.t` through `ServerFindLocals`

Summary:
`ServerFindLocals` is responsible for finding references to a local variable. This powers scenarios such as document-highlights and rename.

Currently, we do a re-parse of the file for every invocation. Document-highlights is one of the most frequent IDE actions taken (since it happens whenever you click anywhere in the document), so that's probably been adding several milliseconds of latency that keeps queueing up.

Switch this to use provider contexts so that we cache the AST that we're using between IDE requests for the same file.

Reviewed By: ljw1004

Differential Revision: D20518728

fbshipit-source-id: 548d3ac349eb2cf3c7f9f319ad3502dd59450d8c
hphp/hack/src/hh_single_type_check.ml
hphp/hack/src/server/serverFindLocals.ml
hphp/hack/src/server/serverFindLocals.mli [new file with mode: 0644]
hphp/hack/src/server/serverFindRefs.ml
hphp/hack/src/server/serverHighlightRefs.ml