List<PsiDirectory> (@NotNull Project project) { Module[] modules = ModuleManager.getInstance(project).getModules(); List<PsiDirectory> directories = new ArrayList<>(modules.length*3); for (Module module : modules) { directories.addAll(collectModuleDirectories(module)); } return directories; }