void (VirtualFile file, Consumer<ListPopup> action) { if (!RevealFileAction.isSupported()) return; List<VirtualFile> files = new ArrayList<>(); List<String> fileUrls = new ArrayList<>(); VirtualFile eachParent = file; while (eachParent != null) { int index = files.size(); files.add(index, eachParent); fileUrls.add(index, getPresentableUrl(eachParent)); if (eachParent.getParent() == null && eachParent.getFileSystem() instanceof JarFileSystem) { eachParent = JarFileSystem.getInstance().getVirtualFileForJar(eachParent); if (eachParent == null) break; } eachParent = eachParent.getParent(); } ReadAction .nonBlocking(() -> ContainerUtil.map(fileUrls, url -> { VirtualFile vFile = LocalFileSystem.getInstance().findFileByNioFile(Path.of(url)); if (vFile == null) return EmptyIcon.ICON_16; if (vFile.isDirectory()) return AllIcons.Nodes.Folder; return FileTypeManager.getInstance().getFileTypeByFile(vFile).getIcon(); })) .finishOnUiThread(ModalityState.nonModal(), icons -> action.accept(createPopup(files, icons))) .submit(AppExecutorUtil.getAppExecutorService()); }