Pycharm cannot find usages, CTRL+Click to follow symbol or refactor code

I have a large project can contains several subfolders of both Java and Python projects. I open this with Pycharm and want to work with the python projects. The problem is, Pycharm does not seem to be able to spot relations between files. Lets say I have two files, A and B where A uses functions in B. If I go into the B file and use "Find usages", it won't show me file A calling it. Also, If I refactor the name for the function in file B, it won't change in A and it won't even complain that it cannot find the name. Likewise if I use CTRL + click on the function name in file A, it won't go to that function. Also, if I go into file b, pycharm won't recognize importing file b. Mind you my code works fine in our test environment, so it's just the IDE which does not seem to recognize it.

As my current task is refactored, I have to go through every file manually now to make sure that it still works before pushing which is quite annoying and takes a lot of time.

It looks as if pycharm doesn't understand how my files are related at all. How can I fix this?

 

I'm running Ubuntu 18.04 with Pycharm Professional 2019.1.3, latest updates on everything. I have tried doing "Invalidate cachces and restart"

1 comment
Comment actions Permalink

I managed to solve it by rightclicking my src folder and marking it as src root.

0

Please sign in to leave a comment.