boolean (@NotNull Processor<? super VirtualFile> processor) { if (myElement instanceof PsiPackage pack) { final Set<PsiDirectory> dirs = new HashSet<>(); ApplicationManager.getApplication().runReadAction(() -> { ContainerUtil.addAll(dirs, pack.getDirectories(GlobalSearchScope.projectScope(myElement.getProject()))); }); for (PsiDirectory dir : dirs) { if (!accept(dir, processor)) return false; } return true; } return super.accept(processor); }