idephpstormphpstorm-2017.2

How can I view the fully qualified name for an imported class


Is there a way I can see (in context) the fully qualified name for an imported class?

e.g. I've got this in the middle of a +200 lines php file:

$this->helper = new ObjectManager($this);

How can I see the full class name for ObjectManager (e.g. \Framework\Helper\ObjectManager) without scrolling to the top (where the use statements are), or navigating to the actual class definition (⌘+B or ⌘+Click)?

I've tried (Alt+Space) but that just displays the constructor definition. I've also tried hovering the cursor over the class and I've checked the top and bottom status bars for any hints. Couldn't find anything.

Thank you.


Solution

  • You can invoke View | Quick Documentation(Ctrl + Q on Windows using Default keymap) and it will tell you general class info: what interfaces it implements, class description (from PHPDoc if present), what namespace it is etc.

    An example for one of the classes from Laravel 5.4 framework:

    enter image description here


    You can also try invoking code completion popup (Ctrl + Space here) with caret placed somewhere close to the end of the class name (so it precisely matches the class) -- it will show what namespace it's from:

    enter image description here