0

The call hierarchy functionality in Pycharm is useful for finding where a function is called but also which functions are called by a particular function. I am using the latter, but when I do this I only see the functions in the current module.

For example if I have a project structured like this:

project/
    moduleA.py
    moduleB.py

And moduleA contains:

import moduleB

def funcA1(x):
    return funcA2(x) + moduleB.funcB1(x)

I can see that the callee methods heirarchy contains funcA2 but not moduleB.funcB1(x). I am using the "Production" scope for this to include files in the current project.

Am I missing something here? I'd like to see all the functions that are being called in the entire project not just the current module. I've tried manually configuring a custom scope that includes all the project files but I get the same result.

Is there a way to view the callee methods heirarchy so that functions that are imported from other modules in the project are included?

pbreach
  • 16,049
  • 27
  • 82
  • 120
  • 1
    Seems like your project isn't indexed. Does your moduleA see system imports? Check that you set correct interpreter in project settings – deathangel908 Jan 17 '19 at 07:48
  • Seems like it probably wasn't I tried to open and close Pycharm to see if it would do an index and now it won't open. I might have to reinstall and try again. – pbreach Jan 17 '19 at 07:53
  • Try to remove .idea and *.iml files and open project again. – deathangel908 Jan 17 '19 at 08:02
  • Removed .idea and *.iml files and re-opened pycharm. After reindexing and letting all other processes finish. It still does not show the callees. I tried building the same project in the hypothetical example in the question and it works as expected. It must have to do with something in my project. – pbreach Jan 17 '19 at 08:27
  • Try to remove files by half. If you have 50 files in your project, remove 25, remove idea and iml files and reopen project and see if it works. Then remove 12 more and so on – deathangel908 Jan 17 '19 at 08:58

0 Answers0