void (StringBuilder buffer, VirtualFile file, Project project) { if (file != null) { ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex(); if (index.isInLibrary(file)) { index.getOrderEntriesForFile(file).stream() .filter(LibraryOrSdkOrderEntry.class::isInstance).findFirst() .ifPresent( entry -> appendStyledSpan(buffer, "[" + StringUtil.escapeXmlEntities(entry.getPresentableName()) + "] ", "color: #909090")); } else { Module module = index.getModuleForFile(file); if (module != null) { appendStyledSpan(buffer, "[" + module.getName() + "] ", "color: #909090"); } } } }