Change explicit declaration step in ServerIdeUtils to use Decl.name_and_declare_types_program
Summary:
There is a comment there explaining why is was necessary, but I think it's not true any more (since
D3234660).
Moreover, as pointed out by dlreeves, there is no reason why this code would work now (and it probably doesn't - Decl_heap_elems_bug anyone?) - all of those Decl. calls assume that parents are declared, which is not true in lazy decl world.
Initially I just removed this code, depending fully on lazy decl, but then realized that while typing will work, there might be hooks in decl phase that would not be executed, depending on whether something is lazily loaded or not (hard to tell whether it's something that actually happens). Instead of removing, switching it to name_and_declare_types_program that ensures that parents will be correctly declared too. As a side effect, naming is ran twice here - during name_and_declare_types_program, and as part of typing. I could probably refactor it to avoid it, but naming speed is negligible, and this code is scare to touch as it is.
Reviewed By: dlreeves
Differential Revision:
D4318381
fbshipit-source-id:
9e181117d16763cd9dc8c69145045454ad9903b1