Pycharm - Cannot find declaration to go to
I had same issue and invalidating cache or reinstalling the app didn't help.
As it turned out the problem was next: for some reasons *.py
files were registered as a text files, not python ones. After I changed it, code completion and other IDE features started to work again.
To change file type go Preferences -> Editor -> File types
I had a case where the method was implemented in a base class and Pycharm couldn't find it.
I solved it by importing the base class into the module I was having trouble with.
Right click on the folders where you believe relevant code is located ->Mark Directory as-> Sources Root
Note that the menu's wording "Sources Root" is misleading: the indexing process is not recursive. You need to mark all the relevant folders.
What worked for me was right-click on the folder that has the manage.py
> Mark Directory as > Source Root.