List<VirtualFile> (@NotNull VirtualFile deepDir, @NotNull Set<? extends VirtualFile> allRoots, @NotNull RootInfo info) { List<VirtualFile> hierarchy = new ArrayList<>(); boolean hasContentRoots = false; for (VirtualFile dir = deepDir; dir != null; dir = dir.getParent()) { hasContentRoots |= info.contentRootOf.get(dir) != null; if (!hasContentRoots && ourFileTypes.isFileIgnored(dir)) { return null; } if (allRoots.contains(dir)) { hierarchy.add(dir); } } return hierarchy; }