Every time we see a Unbound error (error code 2049) we take the code producing the error and pass it to hh_client --search which gives us a list of matches
Each of the match is added to the list of quickfix actions, and shows up when the user hovers over the error in the IDE
Clicking on one of the quick fix actions will append the namespace before the term.
Ideally this functionality can be added to hh_client LSP server and potentially used for autocompletion. I can clean this up and make a PR but the code behind the demo can be find in its WIP here.
I created a proof of concept that uses
hhvm --search
and Code Actions to provide a (rudimentary) namespace suggestions for unresolved symbols.Demo here: https://imgur.com/S9zeQue
How it works:
Every time we see a Unbound error (error code 2049) we take the code producing the error and pass it to
hh_client --search
which gives us a list of matchesEach of the match is added to the list of quickfix actions, and shows up when the user hovers over the error in the IDE
Clicking on one of the quick fix actions will append the namespace before the term.
Ideally this functionality can be added to
hh_client
LSP server and potentially used for autocompletion. I can clean this up and make a PR but the code behind the demo can be find in its WIP here.cc: @Wilfred