Search backend: make isGlobal operate on search.RepoOptions#40236
Conversation
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 6cf2456...9ee745e.
|
7fd797f to
90076c5
Compare
|
Converted to draft because building stuff on top of this was causing circular import issues. |
rvantonder
left a comment
There was a problem hiding this comment.
Approve if it's been run against backend-integration
| isEmpty := noPattern && noFile && noLang | ||
|
|
||
| repoUniverseSearch = isGlobalSearch() && isIndexedSearch && hasGlobalSearchResultType && !isEmpty | ||
| repoUniverseSearch = isGlobalSearch && isIndexedSearch && hasGlobalSearchResultType && !isEmpty |
There was a problem hiding this comment.
nit: maybe st != query.SearchTypeStructural is better as a part of this condition, or the hasGlobalSearchResultType check. then this conditional doesn't hang onto isGlobalSearch. can do in a follow up later though, if tests pass already on this PR just merge don't rerun (was this run against backend-integration or main? don't see it in the PR name
There was a problem hiding this comment.
Yeah, a good followup. This specific PR didn't run backend integration, but there are 3 PRs stacked on top of it that have.
This is a followup from this comment.
Basically,
isGlobalshould operate on theRepoOptionstype rather than the raw query now that the repo options type has all information about what repositories should be searched.isGlobalis not a method onRepoOptionsbecause our backend packages are too intertwined and this causes circular import issues.As part of this, I documented that method heavily because I've historically been quite confused about its behavior.
Test plan
Depending on existing tests. Should be semantics-preserving -- it's just moving logic around.