Skip to content
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

Find only direct references in methods inheriteds from interfaces #3116

Open
MauroVinicius opened this issue Nov 18, 2024 · 0 comments
Open

Comments

@MauroVinicius
Copy link

Feature description or problem with existing feature
Today we already have the "Find all References" option that works correctly to find methods, but when it is used in a method that was inherited from an interface it finds all the references of all classes that use that interface, it would be very useful if there was an option to be able to find only direct references to the method of a specific class

Describe the solution you'd like
As an example is the code below

interface Pokemon
{
	public function fireMove(): string;
}


class Charizard implements Pokemon
{
	public function fireMove(): string
	{
		return 'Blast Burn';
	}
}


class Flareon implements Pokemon
{
	public function fireMove(): string
	{
		return 'Heat Wave';
	}
}


$Pokemon1 = new Flareon;
$Pokemon1->fireMove();

$Pokemon2 = new Charizard;
$Pokemon2->fireMove();

In the example above, pokemon 1 Flareon used fireMove(), but when using "Find All References" in the Flareon class it also shows Charizard's references, in this case it would be very useful an option to find only Flareon's references using fireMove(), ignoring the by Charizard

Removing the interface implementation from both classes makes this happen, but of course I can't keep removing interfaces in the code just to achieve this

Additional context
image

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