Haehnchen / idea-php-symfony2-plugin

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

createQueryBuilder "join" autocompletion not working #2260

Open HWesterhof opened 9 months ago

HWesterhof commented 9 months ago

When defining a repository function, the join autocomplete is not working. From earlier versions (both Symfony and PHPStorm), I know this worked before.

I am able to reproduce this on a blank Symfony project.

    public function testJoin(User $user)
    {
        return $this->createQueryBuilder('p')
            ->join('p.postUser','post_user')
            ->andWhere('post_user.id = :id')->setParameter('id',$user)
            ->getQuery()
            ->getResult();
    }

I can reproduce this with a blank Symfony project. composer.json:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": ">=8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/doctrine-bundle": "^2.11",
        "doctrine/doctrine-migrations-bundle": "^3.3",
        "doctrine/orm": "^2.17",
        "symfony/console": "6.4.*",
        "symfony/dotenv": "6.4.*",
        "symfony/flex": "^2",
        "symfony/framework-bundle": "6.4.*",
        "symfony/runtime": "6.4.*",
        "symfony/yaml": "6.4.*"
    },
    "require-dev": {
        "symfony/maker-bundle": "^1.52"
    },
    "config": {
        "allow-plugins": {
            "php-http/discovery": true,
            "symfony/flex": true,
            "symfony/runtime": true
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php81": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "6.4.*"
        }
    }
}
    #[ORM\ManyToOne]
    private ?User $postUser = null;

It is able to see the ManyToOne in the autocomplete dialog, in the "where" function:

image

But it is NOT able to see it when defining a join:

image