ModCommand (@NotNull ActionContext context) { return ModCommand.psiUpdate(context, updater -> { PsiCatchSection catchSection = updater.getWritable(myCatchSection); PsiCatchSection moveBeforeSection = updater.getWritable(myMoveBeforeSection); PsiTryStatement statement = catchSection.getTryStatement(); statement.addBefore(catchSection, moveBeforeSection); catchSection.delete(); }); }