PsiExpression ( PsiExpression expression) { if (!(expression instanceof PsiArrayAccessExpression)) { return null; } PsiExpression arrayExpression = ((PsiArrayAccessExpression)expression).getArrayExpression(); while (arrayExpression instanceof PsiArrayAccessExpression arrayAccessExpression) { arrayExpression = arrayAccessExpression.getArrayExpression(); } return arrayExpression; }