Pass FindRefs requests from IDE process to typechecker process
Summary:FindReferences works by:
- looking at given symbol dependency table entry for files that might have anything to do with it
- setting appropriate hooks and typechecking all those files, recording when actual references occur
"Typechecking all those files" is an action that needs to be parallelized, but IDE process doesn't have any workers that could do it. Spawning a separate pool of workers for IDE process is an option, but I'm not sure if it's worth it (resource-wise), when they will be sitting idle 99% of time.
Moreover, even with parallelization, getting the results for some popular symbols can take 10+ seconds, so such pool would also not be operated by IDE process which should not block, but a separate process dedicated to it, which is a level of complexity not worth it now. We'll just send the request to master process to be executed when free.
Nuclide is aware of this operation taking long, so when you do find references it shows a popup message in the corner letting users know that information is being fetched now and it will take some time. It works pretty well at calming your nerves, and we want to have similar status message for when server is not ready, instead of stuff simply not working.
Reviewed By: int3
Differential Revision:
D3004827
fb-gh-sync-id:
8575749ff3c7fd665a3cdf5137dc377b82230220
shipit-source-id:
8575749ff3c7fd665a3cdf5137dc377b82230220