Go to method in a class?

I would like to go to a class (that's easy) and once in the class, navigate to a method -- regardless which superclass it's defined in. I can't use Ctrl+B because the class of the variable we call the method on is not known to PHPstorm but I can figure it out and open the class manually.

0
6 comments

Is there a simpler way than ctrl+f12 (file structure), ctrl+f12 (to show inherited members) then type? And that doesn't restrict to methods, even.

0

Navigate | Symbol (Ctrl+Shift+Alt+N) -- can take you anywhere

Since PhpStorm v7.1 you can also use the Search Anywhere functionality (Shift two times) -- but this one is universal and covers much more -- could produce too much irrelevant results for common names (as it searches everywhere, even settings).

0

Navigate Symbol will list all symbols matching not just the method in the specific class I am in.

0

Correct, that's why you can use it even from your original location (before you navigate to the class).

Other than that -- already mentioned Structure panel (which can show inherited methods as well) or Structure Popup is the only ways to go here.

BTW: How do you call that method in first place?? Maybe adding some PHPDoc comment for typehinting will help here (although adding it for the sake of navigation only does not look reasonable at all).

0

Structrure panel it is. I have set it to float and set it up so that it only show methods. Wonderful, thanks!

0

I would just like to add a reminder to this thread that you can also CTRL+Left Click or Middle Click on the usages of a function/method to go directly to the definition.  I use this plus the navigation buttons to quickly dig to a definition and get back out quite often and I really enjoy the functionality.

Edit: This also works for Javascript, CSS, etc.

Note: This is on WIndows, the keys and modifiers are slightly different on OSX.

0

Please sign in to leave a comment.