Documentation
¶
Index ¶
- Constants
- func FormatBlameContext(files map[string]string) string
- func FormatForLLM(files []FetchedFile) string
- func GetChangedLineNumbers(lines []struct{ ... }) []int
- func GetFileBlameContext(filename string, changedLines []int) string
- func GetFileStability(filename string) (stable bool, commitCount int, err error)
- func GetLogForFile(filename string, limit int) ([]string, error)
- type BlameInfo
- type BlameLineInfo
- type FetchedFile
- type Fetcher
- type ImportInfo
- type Resolver
Constants ¶
const ( // MaxFileSize is the maximum size of a referenced file to include MaxFileSize = 10000 // MaxTotalContextSize is the maximum total context from referenced files MaxTotalContextSize = 50000 // MaxFilesToFetch is the maximum number of referenced files to fetch MaxFilesToFetch = 10 )
const (
// StabilityThresholdDays - files not modified in this many days are considered stable
StabilityThresholdDays = 30
)
Variables ¶
This section is empty.
Functions ¶
func FormatBlameContext ¶
FormatBlameContext formats blame information for inclusion in the prompt
func FormatForLLM ¶
func FormatForLLM(files []FetchedFile) string
FormatForLLM formats fetched files for inclusion in the LLM prompt
func GetChangedLineNumbers ¶
func GetChangedLineNumbers(lines []struct {
Type int // 0=context, 1=added, 2=removed
NewNum int
}) []int
GetChangedLineNumbers extracts line numbers that were modified from a hunk
func GetFileBlameContext ¶
GetFileBlameContext gets blame context for a file diff
func GetFileStability ¶
GetFileStability determines if a file is stable (not frequently changed)
Types ¶
type BlameInfo ¶
type BlameInfo struct {
Filename string
LastModified time.Time
Authors []string
AgeInDays int
IsStable bool // True if not modified recently
}
BlameInfo contains git blame information for a file
type BlameLineInfo ¶
BlameLineInfo contains blame info for a specific line
type FetchedFile ¶
FetchedFile represents a file that was fetched for context
type Fetcher ¶
Fetcher fetches referenced files for context expansion
func (*Fetcher) FetchReferencedFiles ¶
func (f *Fetcher) FetchReferencedFiles(files []diff.FileDiff) []FetchedFile
FetchReferencedFiles extracts imports from changed files and fetches their content
type ImportInfo ¶
type ImportInfo struct {
Source string // The file containing the import
ImportPath string // The imported path
ResolvedPath string // The resolved local file path
Language string // The detected language
}
ImportInfo represents an import statement found in a file
type Resolver ¶
type Resolver struct {
RootDir string
}
Resolver resolves imports from code files to their local paths
func NewResolver ¶
NewResolver creates a new import resolver
func (*Resolver) ExtractImports ¶
func (r *Resolver) ExtractImports(filename, content string) []ImportInfo
ExtractImports extracts imports from file content based on language