search: highlight repo:has.description match ranges
Created by: tbliu98
Part of #18374
This PR adds highlighting for ranges in the visible portion of repo descriptions that are matched by repo:has.description
.
- During
RepoSearchJob
construction, compile anyrepo:has.description
patterns into regexes that match case-insensitively and across newline characters - During
RepoSearchJob
execution, get resolved repositories' descriptions from the database, match them against the list of compiled regexes, and return the matched ranges as the fieldDescriptionMatches
onresult.RepoMatch
- Add field
DescriptionMatches
toEventRepoMatch
and populate it with the values fromresult.RepoMatch
infrontend
- Add field
descriptionMatches
toRepositoryMatch
interface in the client - Use
highlightNode
to highlight matched ranges in theRepoSearchResult
component
Test plan
Unit tests, manual testing. highlightNode
is well-tested