Don't use global mutable state for member completion
commite4a24e288b4ad976a85a105e230b092b2a6b7570
authorWilfred Hughes <wilfred@fb.com>
Thu, 6 Jan 2022 20:19:54 +0000 (6 12:19 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 6 Jan 2022 20:21:35 +0000 (6 12:21 -0800)
treef768f63c52fd0b972fd930447c9726d43322a78b
parentf40214b431d5fcb8cd8b7125379326ffef073357
Don't use global mutable state for member completion

Summary:
Previously, we would update several mutable refs whilst inspecting the TAST, compute partial autocomplete results, and only process them later. This was error prone as it was easy to miss some refs.

Instead, compute member completion results as soon as we find the relevant point in the TAST, and don't use the mutable refs.

Reviewed By: hgoldstein

Differential Revision: D32662299

fbshipit-source-id: fc2ed1a0ba17a74139288525880bae0c0d3fa105
hphp/hack/src/server/autocompleteService.ml