PsiAssignmentExpression (@Nullable PsiElement candidate, @NotNull PsiVariable variable) { if (candidate instanceof PsiExpressionStatement exprStatement && exprStatement.getExpression() instanceof PsiAssignmentExpression assignmentExpression && ExpressionUtils.isReferenceTo(assignmentExpression.getLExpression(), variable)) { return assignmentExpression; } return null; }