GlobalSearchScope (@NotNull VirtualFile file, @NotNull Project project) { final GroovyConsoleStateService projectConsole = GroovyConsoleStateService.getInstance(project); final Module module = projectConsole.getSelectedModule(file); if (module == null || module.isDisposed()) return null; GlobalSearchScope moduleScope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module); if (hasNeededDependenciesToRunConsole(module)) return moduleScope; GlobalSearchScope bundledScope = createBundledGroovyScope(project); return bundledScope != null ? moduleScope.uniteWith(bundledScope) : moduleScope; }