String (@NotNull final PsiElement psiElement, @NotNull final ElementDescriptionLocation location) { if (!(location instanceof UsageViewTypeLocation)) return null; if (psiElement instanceof PsiMetaOwner) { final PsiMetaData metaData = ((PsiMetaOwner)psiElement).getMetaData(); if (metaData instanceof PsiPresentableMetaData) { return ((PsiPresentableMetaData)metaData).getTypeName(); } } if (psiElement instanceof PsiFile) { return IndexingBundle.message("terms.file"); } if (psiElement instanceof PsiDirectory) { return IndexingBundle.message("terms.directory"); } String type = LanguageFindUsages.getType(psiElement); if (!type.isEmpty()) { return type; } return TypePresentationService.getService().getTypePresentableName(psiElement.getClass()); }