AI Assistant and features available depending on php version
Using PHP 8.0 - 8.3 for some of my projects, code suggestions provided the AI assistant don't make use of some of the latest features available in this PHP version.
E.g. use Constructor Property Promotion, named arguments, attributes instead of annotations…
While I could specify this in a prompt or store this in the prompt library, it still causes a bit of additional work to have to pull this up for every new chat.
In the help pages, it's stated that:
> PhpStorm provides project-specific context, such as the languages and technologies used in your project.
https://www.jetbrains.com/help/phpstorm/use-prompts-to-explain-and-refactor-your-code.html
But I don't think it's actually looking at the setting in Settings > PHP > PHP language level
Is there anyway to get this to work with the current version of PHPStorm or might this be taken as a feature suggestion?
Please sign in to leave a comment.
In the latest EAP build of PhpStorm: https://www.jetbrains.com/phpstorm/nextversion, it is possible to specify a custom prompt for the current project. This prompt will be applied to all chat instances in the current project. In this case you could try specifying to the AI chat to use the latest features available in PHP 8.
Settings (
⌘ + ,
orCtrl + Alt + S
) > Tools > AI Assistant > Prompt Library > General > Project Prompt.