PsiElement (PsiCallExpression call) { if (call instanceof PsiMethodCallExpression) { return ((PsiMethodCallExpression)call).getMethodExpression().getReferenceNameElement(); } if (call instanceof PsiNewExpression) { return ((PsiNewExpression)call).getClassOrAnonymousClassReference(); } return null; }