show as busy during slow compute_tast
commit3dc2243e6a1123753c2e8a321d204092c5a7feef
authorLucian Wischik <ljw@fb.com>
Thu, 23 Apr 2020 14:28:58 +0000 (23 07:28 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 23 Apr 2020 14:41:14 +0000 (23 07:41 -0700)
treeeb1de63417a624e61d1fca4b2b6dbaadc7fca271
parentdbbf25b5a8bc626ecbf209a44df1c2dacf8de2da
show as busy during slow compute_tast

Summary:
Wen you first start serverless-IDE, and it finishes loading saved-state, then it presents itself as "Ready" -- but the first action you do ends up taking 5-10 seconds to populate the decl cache.

I worried that this is so confusing to users that I called it out as the only "known bug" in the HackIDE release announcement.

This diff changes it to show as busy during RPC calls. It turns on the busy indicator once it's taken longer than 200ms (to avoid flickering on and off during routine use), and turns it off as soon as it's done.

I did this with clientIdeService. That's because we don't have pre-emption inside clientIdeDaemon, hence no way for it to report 200ms into its compute_tast operation.

Reviewed By: arxanas

Differential Revision: D21119740

fbshipit-source-id: bf3005364cda74d9248dab70544a9c3032fa1b4c
hphp/hack/src/client/clientLsp.ml
hphp/hack/src/client/ide_service/clientIdeService.ml
hphp/hack/src/client/ide_service/clientIdeService.mli