idea-php-symfony2-plugin icon indicating copy to clipboard operation
idea-php-symfony2-plugin copied to clipboard

missing route

Open ehymel opened this issue 6 years ago • 7 comments

Similar to previous bug report and the comment that was posted after the bug was closed, this error re-appeared for me. The suggestion from that bug was:

replace use Symfony\Component\Routing\Annotation\Route; with use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;;

however the latter is deprecated. In trying I noticed that simply removing the use Symfony\Component\Routing\Annotation\Route; line, saving the file, then re-adding the exact same line and saving the file again removes the error message in my twig file.

It seems that modifying the Route annotation in my controller triggers a re-scan of the missing route message. Perhaps it would be good to be able to force a re-scan of routes. This would help clear hundreds of 'missing route' messages in my codebase!

ehymel avatar Jan 21 '19 00:01 ehymel

Hello,

I have the same problem. I have missing route, but all exists. I use PHPStorm 2019.1.2 and Symfony 4.3 beta. It's very strange, because it works on other project not in symfony 4.3...

don't hesitate to ask me if you need more information.

Thansk

Dannebicque avatar May 15 '19 17:05 Dannebicque

Same issue with symfony 4.3 in PhpStorm 2019.2 EAP Build #PS-192.5118.33, built on June 13, 2019

isakrubin avatar Jun 14 '19 08:06 isakrubin

+1

mrysz avatar Dec 04 '19 21:12 mrysz

For me none of use statements working, geht always 'route not found'

ThomasTr avatar Apr 30 '20 10:04 ThomasTr

Same issue with symfony 4.4.8, PhpStorm 2020.1.1 Build #PS-201.7223.96, symfony Support plugin 0.20.195 Both use statements show the same behaviour, removing and re-adding does not help, invalidating cache does not help, I don't use the @user annotation (as suggested to be the cause of the problem in the other bug report), some routes are still marked as "missing" even though they work all right.

knallcharge avatar May 27 '20 10:05 knallcharge

This issue seems to be caused by change of urls dumping format into 4.3 (see #28865 in Symfony).

This was addressed into #1438, so issue may be worth to be closed.

FlyingDR avatar Nov 06 '20 13:11 FlyingDR

For me, it seems any annotation that comes right after the starting php tag causes the missing route warnings; see screenshots.

Symfony: 5.4.3 PHPStorm: 2022.1.2 (Build #PS-221.5787.33, built on June 1, 2022) Symfony Support Plugin: 0.23.216 → 2022.1.230

I have found that using a custom PHP Routing path (in Preferences -> PHP -> Symfony -> Routing) that points to var/cache/dev/url_generating_routes.php seems to address the issue, but it'd be nice if the plugin could recognize this file itself.

Problem: screenshot

No Problem: screenshot 1

d42ohpaz avatar Jun 28 '22 15:06 d42ohpaz