boolean (PsiExpression expression) { PsiElement parent = expression.getParent(); while (parent instanceof PsiParenthesizedExpression || parent instanceof PsiPolyadicExpression) { parent = parent.getParent(); } if (!(parent instanceof PsiAssignmentExpression assignmentExpression)) { return false; } PsiExpression lhs = PsiUtil.skipParenthesizedExprDown(assignmentExpression.getLExpression()); if (!(lhs instanceof PsiReferenceExpression referenceExpression)) { return false; } if (assignmentExpression.getOperationTokenType() == JavaTokenType.PLUSEQ) { return true; } final PsiElement element = referenceExpression.resolve(); if (!(element instanceof PsiVariable)) { return false; } final PsiExpression rhs = assignmentExpression.getRExpression(); return isAppended(referenceExpression, rhs); }