nvlad / yii2support

Yii2 Support for PhpStorm / IntelliJ IDEA
https://plugins.jetbrains.com/idea/plugin/9388-yii2-support
Other
295 stars 54 forks source link

Broken Find Usages functionality when the plugin is enabled #268

Open marden opened 3 years ago

marden commented 3 years ago

What steps will reproduce the problem?

The plugin affects "Find usages" in PhpStorm.

I have 2 classes: OpenAction and DefaultController. DefaultController.php:

use frontend\modules\api\actions\OpenAction;

class DefaultController extends ApiController
{
    public function actions(): array
    {
        return [
            'open' => OpenAction::class,
        ];
    }
}

Open the OpenAction file, right-click on the name of the class and select "Find Usages" - PhpStorm shows "No usages found" that's incorrect. If I disable the plugin, "Find usages" works correctly and PhpStorm shows real usages (import & ::class string).

What is the expected result?

The plugin doesn't break the basic "Find usages" functionality.

Additional info

Q A
IDE Name PhpStorm
IDE Version 2020.3
Plugin version 0.10.58.37
likont commented 2 years ago

This is also true for PhpStorm 2022.1.1.

I confirm this.

Yii-Module-Bug-1 Yii-Module-Bug-2

likont commented 2 years ago

@nvlad, dear Vlad! Could you fix this bug? Thank you! It is difficult to work with it....Thank you!

aivchen commented 2 years ago

This is also true for PhpStorm 2022.2

egorrishe commented 1 year ago

Additional info. Each time when I call "Find usages" on __construct() method - I receive different count of usages.

Such behavior even worse, than issue with "No usages", described above. Because, facing "No usages" - developer immediately understand, that something wrong here. So he is looking for workaround.

But it's hard to notice bug, that you receive "different count of usages". Especially, if real count is near 3 - then even if you know about this bug, you have to call "Find usages" ~10 times, to reproduce bug. Only if real count usages is more than 15 - then it's enough to call "Find usages" 2-3 times. So, on some projects, developer may not notice this bug for a long time.

P.S. Anyway, thank you a lot, for this super plugin, which helped me all these years! 🙏

vladgtr commented 1 year ago

This is also true for PhpStorm 2022.1.4.

marius-nabal commented 1 year ago

This bug unfortunately is a killer for this plugin: with no way to reliably check usages, code refactoring is a nightmare.

Imagine wanting to check where a particular property is used and you just can not do so reliably...

The plugin adds great Yii2 features, but if this can't be fixed - working with it is a gamble and I've wasted hours trying to figure out why PHPStorm "randomly" can't find usages properly... Only after disabling all plugins I finally traced the issue to this plugin.

Sometimes it finds the usages, other times not... no rhyme or reason why it works sometimes and other times not.

Unfortunately I'll have to disable this plugin until this is fixed.

Willing to send some $ to get this fixed - let me know!

Example

Find usages, with plugin ENABLED

image

Finds only ONE usage:

image

Find usages, with plugin DISABLED

Finds ALL of them:

image