samdark / yii2-cookbook

Yii 2.0 Community Cookbook
1.45k stars 296 forks source link

IDE autocompletion: not directly possible with current PHPStorm #173

Closed robsch closed 6 years ago

robsch commented 6 years ago

Just a hint, that you might want to add to the documentation: To 'Mark as plain text' the Yii.php file it is required to temporarily remove the vendor/yiisoft/yii2 from the excluded folders. Otherwise nothing happens.

More info here: https://youtrack.jetbrains.com/issue/WI-34936#u=1486048661978

larryli commented 6 years ago

I use a post-package-install script in composer.json file:

"scripts": {
    "post-package-install": [
        "php -r '@unlink(\"vendor/yiisoft/yii2/Yii.php\");'"
    ]
}
samdark commented 6 years ago

@larryli how does it work w/o Yii.php file?

samdark commented 6 years ago

@robsch isn't it fixed?

robsch commented 6 years ago

Sorry to have confused you! I think it's just an issue/bug with PHPStorm itself. Your documentation is not wrong.

On https://yii2-cookbook.readthedocs.io/ide-autocompletion/ you say:

Note: To avoid "Multiple Implementations" PHPStorm warning and make autocomplete faster exclude or "Mark as Plain Text" vendor/yiisoft/yii2/Yii.php file.

I have tried this but I was not able to do it directly. I had to temporarily turn off the exclusion of the folder that contains Yii.php. After that all is perfect!

afaik, it is not fixed.

robsch commented 6 years ago

But close this issue if it's not important enough. It is already documented here in this issue now and one can find it via search enginge.

samdark commented 6 years ago

Are you using latest PhpStorm version? If so, please report it to JetBrains issue tracker since, it seems, it's not there yet. What you've linked to is a bit different.

rob006 commented 6 years ago

It should be fixed in 2017.2: https://youtrack.jetbrains.com/issue/WI-22649