yii2support icon indicating copy to clipboard operation
yii2support copied to clipboard

Broken Find Usages functionality when the plugin is enabled

Open marden opened this issue 3 years ago • 7 comments

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

marden avatar Mar 10 '21 10:03 marden

This is also true for PhpStorm 2022.1.1.

w3lifer avatar May 15 '22 16:05 w3lifer

This is also true for PhpStorm 2022.1.1.

I confirm this.

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

likont avatar May 16 '22 07:05 likont

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

likont avatar Jul 09 '22 16:07 likont

This is also true for PhpStorm 2022.2

aivchen avatar Aug 17 '22 08:08 aivchen

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! 🙏

egorrishe avatar Dec 19 '22 13:12 egorrishe

This is also true for PhpStorm 2022.1.4.

vladgtr avatar Jan 24 '23 13:01 vladgtr

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

marius-nabal avatar Nov 16 '23 18:11 marius-nabal