Documentation
¶
Overview ¶
Package discovery handles code unit discovery and indexing.
Index ¶
- func ChangedFiles(root, ref1, ref2 string) ([]string, error)
- func DeduplicateFileLevel(units []domain.Unit) []domain.Unit
- func DetectedAdapters(langs []LanguageInfo) []string
- func FilterByPaths(units []domain.Unit, paths []string) []domain.Unit
- func FilterChanged(units []domain.Unit, changedFiles []string) []domain.Unit
- func Merge(lists ...UnitList) []domain.Unit
- type DiffResult
- type GenericScanner
- type GoAdapter
- type Index
- type LanguageInfo
- type MovedFile
- type Scanner
- type TSAdapter
- type UnitList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangedFiles ¶
ChangedFiles returns files changed between two git refs (or working tree if ref2 is empty).
func DeduplicateFileLevel ¶
DeduplicateFileLevel removes file-level units when symbol-level units exist for the same file from a language adapter.
func DetectedAdapters ¶
func DetectedAdapters(langs []LanguageInfo) []string
DetectedAdapters returns the unique adapter names needed for detected languages.
func FilterByPaths ¶
FilterByPaths returns units whose paths match any of the given path prefixes.
func FilterChanged ¶
FilterChanged returns only units whose paths appear in the changed files list.
Types ¶
type DiffResult ¶
DiffResult represents changes between two index snapshots.
func Diff ¶
func Diff(old, new_ *Index) DiffResult
Diff computes the difference between an old and new index.
type GenericScanner ¶
type GenericScanner struct {
// contains filtered or unexported fields
}
GenericScanner discovers all files as file-level units.
func NewGenericScanner ¶
func NewGenericScanner(include, exclude []string) *GenericScanner
NewGenericScanner creates a scanner with include/exclude patterns.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index holds a snapshot of discovered code units.
type LanguageInfo ¶
type LanguageInfo struct {
Name string // "go", "typescript", "python", etc.
FileCount int
HasConfig bool // go.mod, package.json, pyproject.toml, etc.
Adapter string // "go", "ts", "generic"
}
LanguageInfo describes a detected language in a repository.
func DetectLanguages ¶
func DetectLanguages(root string) []LanguageInfo
DetectLanguages walks a directory and detects programming languages present.
type MovedFile ¶
MovedFile represents a file rename detected by git.
func DetectMoves ¶
DetectMoves identifies likely file renames between old and new unit lists. Uses git's rename detection when available, falls back to symbol matching.
type Scanner ¶
type Scanner interface {
// Scan discovers all code units under the given root directory.
Scan(root string) ([]domain.Unit, error)
}
Scanner discovers certifiable code units in a repository.
type TSAdapter ¶
type TSAdapter struct{}
TSAdapter discovers TypeScript symbols using regex patterns.
func NewTSAdapter ¶
func NewTSAdapter() *TSAdapter
NewTSAdapter creates a new TypeScript discovery adapter.