GlobalSearchScope (@NotNull LanguageLevel _minimal, @NotNull Project project) { Map<LanguageLevel, GlobalSearchScope> map = CachedValuesManager.getManager(project).getCachedValue(project, () -> { Map<LanguageLevel, GlobalSearchScope> result = ConcurrentFactoryMap.createMap(minimal -> { Set<Module> modules = StreamEx .of(ModuleManager.getInstance(project).getModules()) .filter(m -> LanguageLevelUtil.getEffectiveLanguageLevel(m).isAtLeast(minimal)) .toSet(); return modules == null ? null : new ModulesScope(modules, project); }); return CachedValueProvider.Result.create(result, ProjectRootModificationTracker.getInstance(project)); }); return map.get(_minimal); }