PsiSwitchBlock () { PsiElement codeBlock = getParent(); if (codeBlock != null) { PsiElement switchBlock = codeBlock.getParent(); if (switchBlock instanceof PsiSwitchBlock) { return (PsiSwitchBlock)switchBlock; } } return null; }