search: reduce state dependencies of SearchFilesInRepos
Created by: rvantonder
This converts the signature of SearchFilesInRepos
to only take the arguments needed to do a Zoekt query, Searcher query, and a "mode" setting, instead of all of TextParameters
. It basically just lifts out the construction of smaller state to all callers of SearchFilesInRepos
and SearchFilesInReposBatch
. This action gets the construction of zoekt and searcher queries (i.e., jobs) closer to being upfront. It's a significant change, but not earth shattering (it's semantics-preserving). See inline comments for more.
Here are the call sites that were updated to take the new, reduced set of argument state:
SearchFilesInRepos
- 2 call sites, one in aggregator, and one that is SearchFilesInReposBatch
. I just propagated it up for SearchFilesInReposBatch
as well:
SearchFilesInReposBatch
- 4 call sites in test, 2 call sites in code (suggestions and repoHasFile logic).
All updated callsites, in other words: All call sites
I don't know what's going on with our CI. This passed integration tests but there's something wonky with Go tests. Will come back to it later. Want this up for review.