private static boolean inCaseSection(PsiElement context) {
    if (context.getParent() instanceof GrReferenceExpression &&
        context.getParent().getParent() instanceof GrCaseSection) {
      return true;
    }

    final GrSwitchElement switchElement = PsiTreeUtil.getParentOfType(context, GrSwitchElement.class, true, GrCodeBlock.class);
    if (switchElement == null) return false;

    final GrExpression condition = switchElement.getCondition();
    return condition == null || !PsiTreeUtil.isAncestor(condition, context, false);
  }
private static boolean inCaseSection(PsiElement context)