Icon (PsiClass language) { final Module module = ModuleUtilCore.findModuleForPsiElement(language); if (module == null) return null; Project project = language.getProject(); final PsiClass languageFileType = JavaPsiFacade.getInstance(project).findClass(LanguageFileType.class.getName(), language.getResolveScope()); if (languageFileType == null) return null; PsiClass fileType = findLanguageFileType(language, module, languageFileType); if (fileType == null) return null; final ProjectIconsAccessor iconsAccessor = ProjectIconsAccessor.getInstance(project); final UExpression icon = getReturnExpression(fileType, "getIcon"); final VirtualFile iconFile = iconsAccessor.resolveIconFile(icon); return iconFile == null ? null : iconsAccessor.getIcon(iconFile); }