void (@NotNull ActionContext context, @NotNull PsiStatement statement, @NotNull ModPsiUpdater updater) { PsiExpression expression = updater.getWritable(myExpressionPtr.getElement()); if (expression == null) return; List<PsiExpression> sideEffects = SideEffectChecker.extractSideEffectExpressions(expression); CommentTracker ct = new CommentTracker(); sideEffects.forEach(ct::markUnchanged); PsiStatement[] statements = StatementExtractor.generateStatements(sideEffects, expression); if (statements.length > 0) { PsiStatement lastAdded = BlockUtils.addBefore(statement, statements); statement = Objects.requireNonNull(PsiTreeUtil.getNextSiblingOfType(lastAdded, PsiStatement.class)); } PsiElement parent = statement.getParent(); if (parent instanceof PsiStatement && !(parent instanceof PsiIfStatement && ((PsiIfStatement)parent).getElseBranch() == statement) && !(parent instanceof PsiForStatement && ((PsiForStatement)parent).getUpdate() == statement)) { ct.replaceAndRestoreComments(statement, "{}"); } else { ct.deleteAndRestoreComments(statement); } }