PsiElement (@NotNull PsiElement host) { PsiElement target = host; PsiElement parent = target.getParent(); for (; parent != null; target = parent, parent = target.getParent()) { if (parent instanceof PsiPolyadicExpression) continue; if (parent instanceof PsiParenthesizedExpression) continue; if (parent instanceof PsiConditionalExpression && ((PsiConditionalExpression)parent).getCondition() != target) continue; break; } return target; }