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