@Nullable private String _getInfo(PsiElement psiElement) { if (!(psiElement instanceof PsiFile) || !(psiElement.isPhysical())) { return null; } final PsiFile psiFile = (PsiFile)psiElement; final FileLookupInfoProvider provider = myFileType2InfoProvider.get(psiFile.getFileType()); if (provider != null) { final VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile != null) { final Pair<String, String> info = provider.getLookupInfo(virtualFile, psiElement.getProject()); return info == null ? null : info.second; } } return null; }
public FileInfoManager() { final FileLookupInfoProvider[] providers = FileLookupInfoProvider.EP_NAME.getExtensions(); for (final FileLookupInfoProvider provider : providers) { final FileType[] types = provider.getFileTypes(); for (FileType type : types) { myFileType2InfoProvider.put(type, provider); } } }