[php] PHP Intellisense support is too poor
The intellisense support for PHP is too poor.
- There is no namespace auto complete
- No intellisense for the included namespaces
- No intellisense for native php classes.. \DateTime for example
- The autocomplete appears to be super fuzzy.
class Foo(){ public function bar(){ } }
$x = new Foo() $y-> // Shows bar()
It is poor indeed, and I think this is well suited for an extension. I actually thought about writing one, but I'm not 100% sure how. Maybe someone who wrote the Intellisense support for other language can get me on the right track? I think it will probably be needed to create an AST of the code to get the available symbols. There is an AST parser for PHP, written in PHP itself. So either the language server implementation would have to be in PHP (In PHP everything is synchronous, so would this work with some sort of inifinite while loop checking for input? Would it be beneficial to duplicate the current TypeScript classes for extensions in PHP?) or have an intermediate Node application that calls acts as the language server and calls the PHP AST parser to get the AST (which could get JSON-encoded?).
I've been working on a PHP code-completion plugin called Crane. It's still in the early stages, but already it's a huge improvement over the built-in intellisense.
https://github.com/HvyIndustries/crane
Completion for PHP IntelliSense is tracked here
Closing as the extension has this covered.