MCPcopy Index your code
hub / github.com/coder/coder / searchTrigrams

Function searchTrigrams

agent/filefinder/query.go:141–154  ·  view source on GitHub ↗
(plan *queryPlan, snap *Snapshot)

Source from the content-addressed store, hash-verified

139}
140
141func searchTrigrams(plan *queryPlan, snap *Snapshot) []uint32 {
142 if len(plan.Trigrams) == 0 {
143 return nil
144 }
145 lists := make([][]uint32, 0, len(plan.Trigrams))
146 for _, g := range plan.Trigrams {
147 ids, ok := snap.byGram[g]
148 if !ok || len(ids) == 0 {
149 return nil
150 }
151 lists = append(lists, ids)
152 }
153 return intersectAll(lists)
154}
155
156func searchFuzzyFallback(plan *queryPlan, snap *Snapshot) []uint32 {
157 if len(plan.BasenameQ) == 0 {

Callers 1

searchSnapshotFunction · 0.85

Calls 1

intersectAllFunction · 0.85

Tested by

no test coverage detected