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