Haehnchen / idea-php-symfony2-plugin

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

Twig [Ctrl + Click] not workink. Cannot find declaration to go to #2245

Closed azamalvi closed 11 months ago

azamalvi commented 11 months ago

I just updated my PHPStrom from 2021 to latest 2023.2.3 and now I am facing issues related to Twig files. Now in controller for twig file "Ctrl + Click" does not work and it says "Cannot find declaration to go to". I reinstalled the Symfony plugin also Invalidate the Cache but same issue. What should I do to make it work? Thanks!

Phobetor commented 11 months ago

As mentioned in this other issue this only happens for the classic syntax.

Fails:

'AcmeBundle:Default:error.html.twig'

Works:

'@Acme/Default/error.html.twig'

I updated my whole project to the @ syntax to work around this.

In case someone else also likes to do that here is my regular expression replace:

Search: AcmeBundle:(.+)\:(.+\.twig) Replace: @Acme/$1/$2 (consider that there is no "Bundle" keyword anymore)

azamalvi commented 11 months ago

As mentioned in this other issue this only happens for the classic syntax.

Fails:

'AcmeBundle:Default:error.html.twig'

Works:

'@Acme/Default/error.html.twig'

I updated my whole project to the @ syntax to work around this.

In case someone else also likes to do that here is my regular expression replace:

Search: AcmeBundle:(.+)\:(.+\.twig) Replace: @Acme/$1/$2 (consider that there is no "Bundle" keyword anymore)

Thanks a lot for the solution.