GlobalSearchScope (final @NotNull SearchScope scope, @NotNull Project project) { if (scope instanceof GlobalSearchScope) { return (GlobalSearchScope)scope; } return ReadAction.compute(() -> GlobalSearchScope.filesScope(project, getLocalScopeFiles((LocalSearchScope)scope))); }