I have two methods in my code base. I would like to figure out, if there exists a path in which one will be called from the other. Is there some way to achieve this easily in IntelliJ without digging manually through call hierarchies?
The following might work for you on IntellIJ IDEA 16 and higher. It uses call hierarchies, but automates the digging;-)
Call Hierarchy
Ctrl+Alt+H on method 1. Callee Methods Hierarchy
button in the tool window that appears to show all methods that are called by method 1.Expand All
button a couple of times to show called methods until the desired depth.Find Usages
on method 2 and select the Scope Hierarchy 'Callees of 1'
Result: all calls of method 2 in method 1's call hierarchy.
I've done the following:
Expand All
on the hierarchy panelIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With