PsiAssignmentExpression (PsiElement element) { if(element instanceof PsiExpressionStatement) { element = ((PsiExpressionStatement)element).getExpression(); } if (element instanceof PsiExpression) { element = PsiUtil.skipParenthesizedExprDown((PsiExpression)element); if (element instanceof PsiAssignmentExpression assignment && assignment.getOperationTokenType().equals(JavaTokenType.EQ)) { return assignment; } } return null; }