PsiElement () { PyClass referenceClass = PsiTreeUtil.getParentOfType(myElement, PyClass.class); return referenceClass == null ? null : referenceClass.findInstanceAttribute(myElement.getStringValue(), true); }