Type checking service: Introduce check and declare computation kinds
Summary:
Today, when we type check file `A.php`, we declare dependencies as we encounter them. This leads to bad type checking times on files that depend on a lot of classes. This is relevant in the case of generated files, for example.
The idea of this diff stack is to defer declaring dependencies and discard type errors for `A.php` if its dependencies weren't already available.
=====
Here, the `Type_checking_service` handles file jobs of two types:
1) `Check`: it's a file path and its symbols; we type check this file, like before
2) `Declare`: it's just a file path - we declare this file by forwarding it to `Decl_service`, which now exposes its `decl_file` function
Inside of `check_file`, we reset the set of deferred files, and after we're done, we:
1) EITHER return a set of deferred files converted into `Declare` jobs and a single `Check` job for the current file, which will be added to the queue of files to process
2) OR merge the errors we discovered in the file we type checked just now with the rest of the errors
NOTE: this change would not change any of the current behavior unless the type checker option was
Reviewed By: ljw1004
Differential Revision:
D15869438
fbshipit-source-id:
3afe72a37239530da4a2b7d92a62f13c6c2333d4