boolean (PsiExpression exp) { PsiExpression ancestor = exp; PsiElement parent = ancestor.getParent(); while (parent instanceof PsiParenthesizedExpression) { ancestor = (PsiExpression)parent; parent = ancestor.getParent(); } return parent instanceof PsiExpression && isNegation((PsiExpression)parent); }