13

When I try to use the "Open call hierarchy" function in Eclipse, all of sudden it has stopped working. I don't get any results, it just shows the name of the method I wanted to see the call hierarchy for. This happens for all methods I try, even though they are all called by other methods.

I've tried opening eclipse with -clean -refresh, opening and closing eclipse and the project, updating the project, renaming the .metadata-file, and so far nothing has worked.

I've checked that it searches the whole workspace, and there are no filters on.

6
  • What is the name of the method? I noticed the call hierarchy does not work for common names like clear(), get(), etc. but don't know why.
    – Franky
    Apr 19, 2017 at 7:42
  • It doesn't work for any method I try it on. For instance logEvent, ackAlarm, etc.
    – Bugle
    Apr 19, 2017 at 7:43
  • Possible duplicate of Eclipse IDE - Open Call Hierarchy is empty/broken
    – Nathan
    Apr 21, 2019 at 21:15
  • as specified by @vargapati it is a bug in Eclipse 2019-03
    – Lovin
    Jan 20, 2020 at 11:15
  • This happened with me when I configured a new git project on the same workspace and removed the older git project. Sep 7, 2020 at 6:55

6 Answers 6

25
  1. Exit Eclipse
  2. Go into Workspace Directory/.metadata/.plugins/org.eclipse.jdt.core
  3. Delete savedIndexNames.txt
  4. Delete all *.index
  5. Start Eclipse

The search results should now show up.

6
  • Should work, Check if you are deleting the indexes in the workspace you are currently working with, This can be located at <workspace>/.metadata/.plugins/org.eclipse.jdt.core/. Delete all .index files and savedIndexnames.txt file
    – Nitin Jain
    May 21, 2018 at 22:06
  • Ensure you're searching for metadata from inside the workspace (if this is not clear)
    – leroneb
    Mar 27, 2019 at 18:33
  • Nathan have Suggested stackoverflow.com/questions/15542145/…, Check if this solution work for you
    – Nitin Jain
    Apr 26, 2019 at 16:55
  • 1
    It worked but 5th step should be "Start" since we already exited at step 1st. :) May 26, 2022 at 9:05
  • 1
    I remember this once worked. But not anymore... or not with the current screw up of my eclipse workspace. Sep 26, 2022 at 15:50
14

No need for deleting indexes/re-install eclipse etc.

  1. Go to "Call Hierarchy" tab (open by Ctrl + Alt + h)
  2. On the upper right corner, there are 2 options:
    1. "Show Caller Hierarchy" (icon, 2 dots directing to 1 dot)
    2. "Show Callee Hierarchy" (icon, 1 dot directing to 2 dots)
  3. Change it to "Show Caller Hierarchy"
5
  • 1
    mine is at Show Caller Hierarchy AND set to search workspace and not working Apr 26, 2019 at 3:52
  • @jonathan Heindl thanks for edit. It was just a typo mistake. That sentence was meant towards me. :-)
    – Aman
    May 2, 2019 at 7:06
  • 1
    @Dean Hiller: it is a bug in Eclipse 2019-03. (see bugs.eclipse.org/bugs/show_bug.cgi?id=545293). As it will not be fixed in the 2019-03 version, I updated my Eclipse to the latest available one Integration Build, and it works now.
    – vargapeti
    May 2, 2019 at 9:39
  • Its working thanks for the fix. Jan 18, 2022 at 9:19
  • Save my life,thanks
    – Mr Lou
    Aug 3 at 1:01
3

Go to window->perspective-> reset perspective.

1
  • Not working and will erase your current perspective. If you try this, save your perspective first for restore.
    – zeraDev
    Sep 1, 2022 at 10:05
3

Changing Installed JRE to JDK from Windows|Preferences|Java|Installed JREs worked for me.

2

Change Windows|Preferences|Java|Installed JREs, set the default to a JDK.

Version: 2021-09 (4.21.0)
Build id: 20210910-1417

0

Maybe you have a search scope issue. I faced this issue, my eclipse coul'nt find any callers in third projects that uses the method i selected (i also tryed to remove the indexes, restart eclipse, close/open projects, and that was'nt enough so far). I Eventually realized the caller search has a "Search Scope" , that can be set to current workspace/current Project/working set. The item "search scope" is in the "call hierarchy" window menu, opened by top-right arrow. I set it to "current workspace" and then it was ok

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.