PsiType () { if (!parent.isValid()) return null; PsiType type = parent instanceof PsiMethod ? ((PsiMethod)parent).getReturnType() : ((PsiVariable)parent).getType(); if (type instanceof PsiArrayType) { //also, for c-style array, e.g. String args[] return type.getDeepComponentType(); } return type; }