don't track active state so aggressively
commitdc27c4f9677de6100cf4682cbef487a0002c3cf2
authorLucian Wischik <ljw@fb.com>
Thu, 8 Sep 2022 15:49:52 +0000 (8 08:49 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 8 Sep 2022 15:49:52 +0000 (8 08:49 -0700)
tree888d3fbdfbcec26a7a5c50709f58efb0e1ad8895
parent035655abc063c2002c0b73104af3b94126107ffc
don't track active state so aggressively

Summary:
In response to https://fb.workplace.com/groups/hacklang.eng/posts/9509167932465070

There was a pathology where B.PHP became active, so we moved the "hh_server is starting" diagnostic out of A.PHP into B.PHP, but this triggered a codeAction for A.PHP, so we moved the diagnostic into A.PHP, and so on in an infinite loop.

This diff makes the "hh_server is starting" diagnostic more sticky. It will now appear solely in the alphabetically first file. That way, codeActions won't impact it.

I think the whole concept of "most_recent_file" is dodgy and should be re-examined... either get rid of it entirely if possible, or tame it to only "last opened+edited" file. But that can be left for future work if and when needed.

Reviewed By: Wilfred

Differential Revision: D39211079

fbshipit-source-id: 5b6948f571f86a157409504386f1f4c92ef31e82
hphp/hack/src/client/clientLsp.ml
hphp/hack/test/integration/test_lsp.py