How to activate "go to definition" in Eclipse for inherited class property
I have a base class (lets call it A) and I have inheriting Class (lets call it AA).
In a different abstract class I have:abstract class DifferentClass{
/**
*@var A
*/
protected MyA;
}
In a more different class:
class MoreDifferent extends DifferentClass{
public function __construct(){
$this->MyA = new AA;
}
}
My problem is when I ctrl+开发者_StackOverflowleft click on MyA
in the inheriting class, it will take me to the original class A file. I would like it to take me to the AA
file.
I think it's because the only "phpdoc" thing you've done is show that the protected MyA property is of type "A".
The phpdoc definitions are not going to pick up anything from the " = new AA" code line itself.
I think you could potentially locally sort-of-override this behavior by making an explicit relisting of "protected MyA" in your MoreDifferent class, and put a docblock there that shows "@var AA". I don't really see any other option to get the behavior you're after.
精彩评论