PsiJavaCodeReferenceElement (@NotNull PsiJavaCodeReferenceElement referenceElement) { PsiElement parent = referenceElement.getParent(); while (parent instanceof PsiJavaCodeReferenceElement) { referenceElement = (PsiJavaCodeReferenceElement)parent; parent = parent.getParent(); } return referenceElement; }