boolean (@NotNull PsiElement e) { if (e instanceof PsiSwitchLabeledRuleStatement switchLabeledRuleStatement) { return switchLabeledRuleStatement.getEnclosingSwitchBlock() instanceof PsiSwitchStatement; } if (e instanceof PsiStatement || e instanceof PsiWhiteSpace) { if (e.getNextSibling() instanceof PsiSwitchLabeledRuleStatement || e.getPrevSibling() instanceof PsiSwitchLabeledRuleStatement) { return false; } return e.getParent() instanceof PsiCodeBlock && e.getParent().getParent() instanceof PsiSwitchStatement; } return false; }