Implement select: (RFC 254)
Created by: rvantonder
Implementation plan for select:
in the search query:
Backend
@camdencheek will start off on the backend work items. Feel free to create GH issues to track break down these tasks independently. Some guidance and thoughts:
-
#18073 define a data type ("schema") for selecting on a result set. I.e., a definition we can use as ground truth to validate against select values. If we see select:repo
orselect:file.path
, we want to validate that this selected value is legal/valid. We use this value to drive the filtering on the data itself, which will make use of our internal data types likeCommitSearchResolver
,FileMatch
, and so on. We'll iterate on this together, since we need something similar in the frontend for checks/autocomplete suggestions.It'd be great if we can reorganize and refactor around our result types as we go. If possible, we should look into factoring out result set types to
internal/search
, rather than use theresolver
result types, but this might be more involved than it sounds, so let's see. -
#18073 recognize select
in queries -
#18073 create function(s) that take a result set and selection value, and filters results of that type. This is the code we'll invoke when we see select
, as a post-processing step. -
Investigate select:repo
optimization and interaction withshow more
functionality. https://github.com/sourcegraph/sourcegraph/issues/18275
Related PRs: #18192
Additional, straightforward and sensible selectors beyond the basic ones we can support:
-
Support select
on fields forsymbol.kind
#18808 #18910
Frontend
@rvantonder will start off on frontend work items:
-
define and use the same data type ("schema") for validating user queries in the webapp above #18125 -
add basic select
recognition and highlighting/hovers #18125, #18362 -
add autocomplete suggestions for queries #18125, #18196 -
add metrics to track usage in pings => moved tracking to https://github.com/sourcegraph/sourcegraph/issues/18584 -
document implementation details and decisions around result type selection
The above is expected to take 1.5 to 2 weeks while both @camdencheek and @rvantonder work on the above. This aligns with RFC 254 estimate of 3.5 weeks total for the select
implementation and +- 1 week for metrics data. We'll balance out work as we go along.