void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiExpression expression = ObjectUtils.tryCast(element, PsiExpression.class); if (!(getArrayExpressionOrItself(expression) instanceof PsiReferenceExpression)) { return; } final PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent()); if (parent instanceof PsiVariable) { expression.delete(); } if (!(parent instanceof PsiAssignmentExpression assignmentExpression)) { return; } final PsiExpression lhs = assignmentExpression.getLExpression(); final PsiExpression rhs = assignmentExpression.getRExpression(); if (PsiTreeUtil.isAncestor(lhs, expression, false)) { if (rhs != null) { assignmentExpression.replace(rhs); } else { assignmentExpression.delete(); } } else { final PsiElement grandParent = assignmentExpression.getParent(); if (grandParent instanceof PsiExpressionStatement) { grandParent.delete(); } else { assignmentExpression.replace(expression); } } }