bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.6k stars 93 forks source link

Unable to find only references of overridden method #1675

Open jakewisse opened 3 years ago

jakewisse commented 3 years ago

First off, my apologies if there's an issue for this somewhere and I've missed it, or this is intended behavior and this is a feature request instead.

Describe the bug

When finding all references to a method on a derived class that overrides an inherited method, results include references to the inherited method along with all overrides of it in other derived classes.

To Reproduce (Normally with PSR-4 autoloading via Composer, but here's some example code in one file)

<?php

namespace MyProject;

class Command
{
    public function execute()
    {
    }
}

class ThisCommand extends Command
{
    public function execute()
    {
    }
}

class ThatCommand extends Command
{
    public function execute()
    {
    }
}

class Main
{
    public function doThings()
    {
        $thisCmd = new ThisCommand();
        $thisCmd->execute();

        $thatCmd = new ThatCommand();
        $thatCmd->execute();

        $cmd = new Command();
        $cmd->execute();
    }
}

Expected behavior

Only the definition and

$thisCmd->execute();

are found.

Platform and version

Intelephense version: 1.6.3 (premium) OS: MacOS Big Sur, 11.2.1

jakewisse commented 3 years ago

Seeing as cmd+shift+O only shows methods defined in the current class and not inherited ones, I'm assuming this is a feature request.