Monorepo for Tangled
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647package models
import ( "github.com/bluesky-social/indigo/atproto/syntax" "github.com/sourcegraph/zoekt")
// Result is a single matched file. A zoekt FileMatch is either a filename// match or a set of content matches, never both: File is set for the former,// Chunks for the latter.type Result struct { RepoDID syntax.DID FilePath string Branches []string // branch names Commit string // commit id Language string
File *Result_FileMatch // set for a filename match Chunks []Result_ChunkMatch // set for content matches}
type Result_FileMatch struct { // Ranges are the matched span(s) within FilePath. LineNumber is always 1 for // filename matches; Column is 1-based and in runes. Ranges []zoekt.Range}
type Result_ChunkMatch struct { // Content is a contiguous run of complete lines that fully contains Ranges. Content string // ContentStartLine is the 1-based line number of Content's first line. ContentStartLine int // Ranges are the matched span(s) within the file. LineNumber/Column are // 1-based, Column is in runes. A Range may span multiple lines. Ranges []zoekt.Range}
// IsFileMatch tells if search result is from file-name matchfunc (r *Result) IsFileMatch() bool { return r.File != nil}
// IsChunkMatch tells if search result is from chunk matchfunc (r *Result) IsChunkMatch() bool { return len(r.Chunks) > 0}