I just moved to IntelliJ from Eclipse. I know how to get call hierarchy for methods (by pressing Ctrl+Alt+H), however, I can't get call hierarchy for classes (not type hierarchy), when I press Ctrl+Alt+H on the class name, nothing happened, when I use navigate->call hierarchy, the menu entry cannot be clicked (gray color). I need to know where the class gets called/initialized. This cool feature is in Eclipse, so I think IntelliJ also has this too.

有帮助吗?

解决方案

You should be able to do the call hierarchy on a constructor. Alternatively, I've always found a usage search more useful than the call hierarchy.

Press Alt+F7 on a class, method, or field or right click and select "Find Usages". The results are categorized (new instance creation, type parameter, import, etc) so it's extremely simple to find what you're looking for.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top