Haehnchen / idea-php-symfony2-plugin

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

Autocompletion for Twig template names in Twig strings is confusing #1384

Open stof opened 5 years ago

stof commented 5 years ago

With this code (where | represents the cursor):

{% include '@Web/JS/re|' only %}

the autocompletion for template name does not restrict choices to template names starting with @Web/JS/re (it looks like it takes only the re part into account for filtering, even though the prefix seems to impact priority of choices as the expected one comes first). And accepting the autocompletion (be it with Enter or Tab) produces this broken code:

{% include '@Web/JS/@Web/JS/reference_uploader.html.twig' only %}
stof commented 5 years ago

Given that 99.9% of templates names in my project include a /, this makes the completion quite painful.

ruudk commented 5 years ago

I can confirm that this is not working as it should. I tried to look into this but I cannot find where this piece of code is invoked. But it seems like something simple that I can fix. @Haehnchen can you point me where this is located, then I will try to provide you with a PR 😊