Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
910 stars 137 forks source link

Twig: don't autocomplete short forms for object properties/methods #2024

Open drjayvee opened 1 year ago

drjayvee commented 1 year ago

Twig supports convenience short forms for properties and methods (see "Implementation" box in docs).

For example,

{# @var user \User #}
{{ user.admin }}

can refer to a property $admin or any of the methods admin(), getAdmin(), isAdmin(), hasAdmin().

The plugin always autocompletes using the short form: image

This makes it so much harder to refactor properties and methods because

The end result is that unless developers spend significant time diligently checking all templates, bugs will occur after refactoring.

Therefore, I propose that the plugin should autocomplete using the full property or method name, or at the least make this behavior configurable.

drjayvee commented 5 months ago

@Haehnchen did you change this behavior in the latest release? I didn't spot any such change in the plugin's "What's New" tab, but it does work pretty much exactly as proposed here!

Danke sehr.

Nevermind, I was mistaken! The plugin still completes to short-hand.