boolean (PsiElement expr) { PsiElement cur = expr; while (cur != null && !(cur instanceof PsiMember)) { PsiElement parent = cur.getParent(); if (parent instanceof PsiBinaryExpression binOp && cur == binOp.getROperand()) return true; cur = parent; } return false; }