In my PsiTreeChangeListener, in the event handler childAdded(), when the added child is a method I want to use resolve() on its parameters' types to get corresponding classes.
For example, if the newly added method is foo(X x, Y, y), then in the event handler I call resolve() on the parameter types corresponding to X and Y. However, it sometimes happen that I get an error:
Invalid stub element type in index with a file name and the found stub. What is the reason for that? I believe it's that I'm trying to call resolve() before IntelliJ has updated its stub indexes. Is there any way to overcome it?