PsiReferenceExpression (PsiExpression expression) { PsiElement parent = expression; while (parent instanceof PsiParenthesizedExpression || parent instanceof PsiPolyadicExpression) { parent = parent.getParent(); } if (!(parent instanceof PsiAssignmentExpression)) return null; return ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprDown(((PsiAssignmentExpression)parent).getLExpression()), PsiReferenceExpression.class); }