PsiExpression (PsiExpression expr, @NotNull PsiElement element) { PsiElement expression = element; while (expression != null) { if (PsiEquivalenceUtil.areElementsEquivalent(expression, expr)) { PsiExpression psiExpression = (PsiExpression)expression; return PsiUtil.isAccessedForWriting(psiExpression) ? null : psiExpression; } expression = PsiTreeUtil.getParentOfType(expression, PsiExpression.class); } return null; }