8000 [RPC] Cannot find references of abstract protected method · Issue #2791 · phpactor/phpactor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[RPC] Cannot find references of abstract protected method #2791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alquerci opened this issue Nov 24, 2024 · 0 comments
Open

[RPC] Cannot find references of abstract protected method #2791

alquerci opened this issue Nov 24, 2024 · 0 comments

Comments

@alquerci
Copy link

Given files

composer.json

{
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    }
}

src/AbstractClass.php

<?php

namespace App;

abstract class AbstractClass
{
    abstract protected function someMethod();
}

src/ImplementationClass.php

<?php

namespace App;

class ImplementationClass extends AbstractClass
{
    protected function someMethod()
    {
    }

    public function anotherMethod()
    {
        $this->someMethod();
    }
}

Steps to reproduce

  1. Put cursor at line 7 on the character "M" of someMethod of file src/AbstractClass.php
  2. Execute :call phpactor#rpc('references', {'filesystem': 'composer', 'offset': phpactor#_offset(), 'source': phpactor#_source(), 'path': phpactor#_path()})

Expected

Same behaviour as find references of interface method.

Find results

src/AbstractClass.php|7 col 33| abstract protected function someMethod();
src/ImplementationClass.php|7 col 24| protected function someMethod()
src/ImplementationClass.php|13 col 16| $this->someMethod();

Actual

Found 1 literal references to method "someMethod" using FS "composer"

Additional insights

  • It has the same result with git and simple filesystem.
  • It has the same result if the method or class is not abstract.
  • Using call phpactor#GotoImplementations() have an empty result.
    • But after building the index, it will find the implementation as expected.
    • However, it is still missing to find references of the usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0