boolean (@NotNull VirtualFile file, @Nullable Collection<? extends VirtualFile> roots) { if (roots == null || roots.isEmpty()) return false; VirtualFile parent = file; while (parent != null) { if (roots.contains(parent)) { return true; } parent = parent.getParent(); } return false; }