void (@NotNull ActionContext context, @NotNull PsiSwitchLabelStatementBase labelStatementBase, @NotNull ModPsiUpdater updater) { PsiSwitchBlock switchBlock = labelStatementBase.getEnclosingSwitchBlock(); if (switchBlock == null) return; PsiCodeBlock blockBody = switchBlock.getBody(); if (blockBody == null) return; PsiSwitchLabelStatementBase nextLabel = PsiTreeUtil.getNextSiblingOfType(labelStatementBase, PsiSwitchLabelStatementBase.class);//include comments and spaces if (nextLabel != null) { PsiElement lastStmtInDefaultCase = nextLabel.getPrevSibling(); blockBody.addRange(labelStatementBase, lastStmtInDefaultCase); blockBody.deleteChildRange(labelStatementBase, lastStmtInDefaultCase); } }