SourceScope (final Project project) { return new SourceScope() { @Override public GlobalSearchScope getGlobalSearchScope() { return GlobalSearchScope.allScope(project); } @Override public Project getProject() { return project; } @Override public Module[] getModulesToCompile() { return ModuleManager.getInstance(project).getModules(); } @Override public GlobalSearchScope getLibrariesScope() { return getGlobalSearchScope(); } }; }