Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ call hierarchy of fields

Eclipse JDT has a 'call hierarchy' feature -- start from a field/method and it recursively finds all references.

IntelliJ also implements this, but it only works from methods. For fields, you can only 'Find Usages', so if you want to dig deeper you have to do additional searches.

Tried 'Dataflow to here', but it's not what I'm looking for.

Am I missing something? Is there a better way to explore field usage in IntelliJ?

like image 910
Valentin Milea Avatar asked Dec 12 '10 10:12

Valentin Milea


People also ask

How can I see call stack in IntelliJ?

To open the Call Stack windowSelect the menu item View | Call Stack.

What is Open Call Hierarchy in eclipse?

In the Java perspective, Call Hierarchy view shows callers and callees for the selected Java member. In the JavaScript perspective, Call Hierarchy view shows callers and callees for the selected JS member. Both Java and JavaScript perspectives (as well as their views) are the part of the Eclipse-based IDE.

How do I show class methods in IntelliJ?

By default, IntelliJ IDEA shows all classes, methods, and other elements of the current file. To toggle the elements you want to show, click the corresponding buttons on the Structure tool window toolbar. to show class fields. to have protected class members shown in the tree.


1 Answers

Select the method you're interested in and then use from the top menu "Navigate > Call Hierarchy" or simply Ctrl+Alt+H.

AFAIK this doesn't work for fields, because when I select a field, the "Navigate > Call Hierarchy" option becomes grayed-out. The only similar featutes I'm aware of for fields are "Edit > Find > Find Usages" (Alt+F7) and "Edit > Find > Show Usages" (Ctrl+Alt+F7).

like image 77
machinery Avatar answered Sep 23 '22 05:09

machinery