Once I've found a reference to an element using
I'd like to take the element that is found, find the method that's containing that element and do a reference search on that. I need to walk my code all the way to completion. I'm having trouble picturing what exactly an element is, along with what it's siblings, parents and children are. I had hoped that getting the parent would give me the containing method of the element but no dice. How do I find the containing method and get the element of it so I can call a reference search on it?
Additionally, I can't find a good explanation on what a PsiElement is. In that if I were to have a PsiElement I can't quite picture how that sits in reference to my code.