GlobalSearchScope () { final Set<Module> dirtyModules = getAllDirtyModules(); if (dirtyModules.isEmpty()) return myExcludedFilesScope; GlobalSearchScope dirtyModuleScope = GlobalSearchScope.union(dirtyModules .stream() .map(Module::getModuleWithDependentsScope) .toArray(GlobalSearchScope[]::new)); return dirtyModuleScope.union(myExcludedFilesScope); }