use of com.intellij.openapi.compiler.ex.CompileContextEx in project intellij-community by JetBrains.
the class InspectionValidatorUtil method expandCompileScopeIfNeeded.
public static Collection<VirtualFile> expandCompileScopeIfNeeded(final Collection<VirtualFile> result, final CompileContext context) {
final ProjectFileIndex index = ProjectRootManager.getInstance(context.getProject()).getFileIndex();
final THashSet<VirtualFile> set = new THashSet<>();
final THashSet<Module> modules = new THashSet<>();
for (VirtualFile file : result) {
if (index.getSourceRootForFile(file) == null) {
set.add(file);
ContainerUtil.addIfNotNull(modules, index.getModuleForFile(file));
}
}
if (!set.isEmpty()) {
((CompileContextEx) context).addScope(new FileSetCompileScope(set, modules.toArray(new Module[modules.size()])));
}
return result;
}
Aggregations