Assignment (@NotNull PsiAssignmentExpression assignment) { PsiExpression rhs = assignment.getRExpression(); if (rhs == null) return null; PsiReference reference = tryCast(assignment.getLExpression(), PsiReference.class); if (reference == null) return null; PsiVariable lhs = tryCast(reference.resolve(), PsiVariable.class); return lhs == null ? null : new Assignment(lhs, rhs); }