show what it's working on, not [ready]
Summary:
A user reported, "hack says [ready] but it's not working".
More generally, I think the underlying user need is to have transparency about what hack is doing when it's not giving you your answers immediately.
To answer this holistically we need to think about the whole lifecycle of the server:
1. It starts with loading saved-state
2. Once ready, it calls ServerClientProvider.sleep_and_check. This waits for an incoming request, up to 1s. If the IDE was active then it might deny command-line requests. If no request arrived then it does a slice of GC collection and does idle processing.
3. It usually processes all outstanding disk changes at this point. Except, if IDE is active, or if it got interrupted, then it doesn't.
4. It handles the incoming request if there was one
5. And repeats from step 2
The current behavior:
* it shows [ready] at start of step 2
* it shows [typechecking] or similar message during the processing in step 3
The current behavior fails to convey some important user-relevant information, e.g. is it busy doing step 4 from some previous request? is a command-line request being denied because of IDE activity? It also misleading says "ready" when hh_server isn't ready, e.g. if it's got to first handle a lengthy step 4 from some previous request.
This diff is a step along the way to improvement. What it does do:
* No longer display "ready" at a misleading time
* Display information about an ongoing step 4
* Display if IDE is active
Reviewed By: dabek
Differential Revision:
D24239724
fbshipit-source-id:
a293c9f7dcf6658d7afe6dd66f32b8f5e29ce8ef