SourceScope () { final String dirName = getConfiguration().getPersistentData().getDirName(); final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(dirName)); final Project project = getConfiguration().getProject(); final GlobalSearchScope globalSearchScope = file == null ? GlobalSearchScope.EMPTY_SCOPE : GlobalSearchScopesCore.directoryScope(project, file, true); return new SourceScope() { @Override public GlobalSearchScope getGlobalSearchScope() { return globalSearchScope; } @Override public Project getProject() { return project; } @Override public GlobalSearchScope getLibrariesScope() { final Module module = getConfiguration().getConfigurationModule().getModule(); return module != null ? GlobalSearchScope.moduleWithLibrariesScope(module) : GlobalSearchScope.allScope(project); } @Override public Module[] getModulesToCompile() { final Collection<Module> validModules = getConfiguration().getValidModules(); return validModules.toArray(Module.EMPTY_ARRAY); } }; }