Features Releases

Per-Project PHP Extension Settings in PhpStorm 2017.1

Code completion in PhpStorm is one of the most important and most used features that the IDE has, and PhpStorm 2017.1 comes with new settings that help completion be more relevant, and faster.

Some of the best features that make it into PhpStorm come from suggestions from our amazing users, and this feature is no different. Why should you have code completion suggestions for extensions that aren’t even installed in your version of PHP? You shouldn’t, and PhpStorm 2017.1 allows you to disable completion for extensions you don’t use.

You can find a list of extensions to enable or disable by going to Languages & Frameworks | PHP | PHP Runtime:

php-runtime

We understand this isn’t ideal, and wanted to share with you our plans for this feature in the future. Because PhpStorm knows exactly which PHP interpreter you are developing against, in future releases we hope to auto-detect the extensions that are available in the IDE from those that are installed for PHP. This means that you will only have completion on the extensions you are using in your project, making completion more useful, and quicker.

We are also hoping to add new functionality to PhpStorm to detect when you have not enabled extensions in PhpStorm but are using them in your code. This should make it easier to enable those extensions you are using but have not told PhpStorm.

In the future, this could be extended to detect when you are trying to use functions from extensions you don’t have installed for PHP. It would be very useful to find out at coding time that you are using an extension you don’t have installed, rather than having to run your code and understand the error.

The upshot of these improvements will be that we can accept stubs (the annotated code that PhpStorm uses to fire completion in the IDE) from more third-party extension developers, as we can disable them when not installed. The big problem with including more and more stubs in PhpStorm has always been the trade-off between functionality and speed – the more stubs we include, the more complete your experience, but the slower the IDE becomes. We’re hoping to turn lots of extensions by default as soon as 2017.2, and we’re already accepting more stubs in preparation.

Thanks for continuing to support PhpStorm. Hopefully, the improvements in PhpStorm 2017.1 and the coming improvements in future versions will make your development experience faster and more effective!

– Gary & The PhpStorm Team

image description