Bad template completion in controller and missing completion for repositories.
I have same problem, but it occurred not after upgrade to Symfony 5, but doctrine/persistence 1.3, which included deprecation of Doctrine\Common\Persistence* namespaces in favor of Doctrine\Persistence*. I believe this change could've broken completions for everything Doctrine related.
Hope this info helps a bit.
Right, since upgrading DoctrineBundle 2 with the persistence library, it has stopped getting autocompletion on the controller.
@Lustmored thanks for you feedback: For Doctrine interface changes: https://github.com/Haehnchen/idea-php-symfony2-plugin/pull/1404
@doriangrelu What do you mean by "Bad template completion"?
I guess at least: https://github.com/Haehnchen/idea-php-symfony2-plugin/pull/1394; i will also check if latest controller classes are included
hopefully i catched all methods, looks now much better via 0.19.187
Hello @Haehnchen ,
I just updated the plugin and cleaned the cache of both PHPStorm editor and Symfony plugin using the clear index button, and I still don't have the autocomplete:
TestController.php example:
$em = $this->getDoctrine()->getManager();
$repository = $em->getRepository(Entity::class)->Not autocompleted->customRepositoryMethod();
$query = $em->getRepository(Entity::class)->createQueryBuilder('e')->Not autocompleted->leftJoin();
If I use$this->getDoctrine() without the getManager() it works, but it should work with getManager(), right?
I have many repositories that act as a service and therefore extends Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository, which in fact extends Doctrine\ORM\EntityRepository, that implements Doctrine\Common\Persistence\ObjectRepository which is an alias for \Doctrine\Persistence\ObjectRepository.
Long story short - two easily recognisable problems:
My reasoning is that maybe class aliases are somewhere not correctly recognized, so in mentioned ObjectRepositoryResultTypeProvider there should be. I will follow with pull request trying to match all "legacy" namespaces with their new couterpart.
I've tried to set up everything for plugin development, but failed so far, so I only know my version builds and Gradle "verifyPlugin" script runs OK.
I see there is a new version with PR merged in. After clearing indexes and running inspection throughout my rather large project there is just one or two type compatibility issues instead of hundreds that were before. Also code completion for repositories works as intended.
So at least all problems I have encountered seems fixed.
I don't currently have an autocomplete with Doctrine.
For me it is also still broken with Doctrine. In IDEA Ultimate (if this makes any difference)

Same for me with Symfony 3.4, Doctrine getRepository are no longer working with PHPStorm 2020
issues for 2020.x are also reflect in fail tests. https://github.com/Haehnchen/idea-php-symfony2-plugin/pull/1453
Most helpful comment
I have same problem, but it occurred not after upgrade to Symfony 5, but doctrine/persistence 1.3, which included deprecation of Doctrine\Common\Persistence* namespaces in favor of Doctrine\Persistence*. I believe this change could've broken completions for everything Doctrine related.
Hope this info helps a bit.