HvyIndustries / crane

PHP Intellisense/code-completion for VS Code
https://hvy.io/crane
Other
240 stars 25 forks source link

Comparing other PHP intellisense extensions #386

Closed eimajenthat closed 6 years ago

eimajenthat commented 6 years ago

I have been using VS Code for PHP development for some time now, and have been using Felix Becker's PHP IntelliSense extension most of that time. Recently, I noticed that there are actually 3 fairly popular VS Code extensions for PHP intellisense (along with some less popular ones I've bypassed for expediency):

This raises several questions for me:

  1. Why create a new extension for what appears to be the same thing, instead of contributing to the existing one? I don't know who arrived first, just a general question.
  2. Does one extension offer significant features the others lack? Perhaps they are focused on different use cases?
  3. Should I have more than one installed? Will they play nicely together? Will I get any added value from doing so?
darxed commented 6 years ago

I'm just doing the same thing, and found that InteliSense (non Crane) is just awfully slow on big projects. My setup is Intelephense, Intellisense Crane and leaving vs code suggest on, cause both extensions miss somethings. Hope it helps

eimajenthat commented 6 years ago

So you're using both Crane and Intelephense?

ichiriac commented 6 years ago

Hi,

Crane was the first third party php extension on vscode, then few month later it was followed by felixfbecker's version.

The same question was answered at that time here : https://github.com/HvyIndustries/crane/issues/141

The main difference between crane & felixfbecker.php-intellisense is that crane is using a PHP parser written in JS instead using a parser based on PHP. The main reason was to provide a parser that parses files without having to install PHP or handle the right PHP version.

Additionally, a parser requires a high number of string manipulations, function calls, files IO, and consumes memory, and on each part PHP is slower than NodeJS. That's the main reason why php-intellisense does not scales well on larger projects.

bmewburn.vscode-intelephense-client is another implementation based on TypeScript so in principle more efficient than php-intellisense. Here the parsers and their differences :

Microsoft has also provided a parser but again based on PHP (with same performance bottlenecks), and it's almost the same as bmewburn/php7parser :

darxed commented 6 years ago

@eimajenthat Yes, I'm using both and leaving VS Code suggestions activated too. They work well together even if there are some cases when I get duplicate suggestions

eimajenthat commented 6 years ago

Thanks for the information everyone! I'm going to mark this closed as I've received excellent and thorough answers. But if anyone else wants to comment, feel free. Thanks again!