.getIncludedFilesForModule(module);
if (includedFilesForModule != null && !includedFilesForModule.isEmpty()) {
return includedFilesForModule;
}
final Collection<ErlangIncludeFile> includedFiles = module.getIncludeFiles();
final IErlProject project = modelUtilService.getProject(module);
if (project == null) {
return result;
}
final Collection<IErlModule> includes = project.getIncludes();
includes.addAll(getLocalIncludes(module));
Collection<IErlModule> externalIncludes = null;
Collection<IErlModule> referencedIncludes = null;
Collection<IErlModule> modules = null;
for (final ErlangIncludeFile includeFile : includedFiles) {
final String includeFileName = includeFile.getFilenameLastPart();
if (findAllIncludedFilesAux(checked, result, includes, includeFileName)) {
continue;
}
if (referencedIncludes == null) {
referencedIncludes = Lists.newArrayList();
final Collection<IErlProject> referencedProjects = project
.getReferencedProjects();
for (final IErlProject referencedProject : referencedProjects) {
referencedIncludes.addAll(referencedProject.getIncludes());
}
}
if (findAllIncludedFilesAux(checked, result, referencedIncludes,
includeFileName)) {
continue;
}
if (externalIncludes == null) {
externalIncludes = project.getExternalIncludes();
}
if (findAllIncludedFilesAux(checked, result, externalIncludes,
includeFileName)) {
continue;
}
if (modules == null) {
modules = project.getModules();
}
findAllIncludedFilesAux(checked, result, modules, includeFileName);
}
ErlModelCache.getDefault().putIncludedFilesForModule(module, result);
return result;