PsiMember (PsiElement expression) { PsiMember parent = PsiTreeUtil.getParentOfType(expression, PsiClassInitializer.class, PsiEnumConstantInitializer.class, PsiMethod.class, PsiField.class); if (parent instanceof PsiMethod && !((PsiMethod)parent).isConstructor()) return null; return parent; }