CompileScope (final String[] moduleNames) { final List<Module> modules = new ArrayList<>(); for (String name : moduleNames) { modules.add(getModule(name)); } return new ModuleCompileScope(myProject, modules.toArray(Module.EMPTY_ARRAY), false); }