code

package
v0.0.0-...-360da0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindInDirectory

func FindInDirectory(dir string, extensions set.Set[string], callback Consumer[string]) error

Types

type Chunk

type Chunk struct {
	Id       string        `json:"id"`
	Content  string        `json:"content"`
	Metadata ChunkMetadata `json:"metadata"`
}

type ChunkMetadata

type ChunkMetadata struct {
	FilePath     string `json:"file_path"`
	FunctionName string `json:"function_name,omitempty"`
	ClassName    string `json:"class_name,omitempty"`
	StartLine    int    `json:"start_line"`
	EndLine      int    `json:"end_line"`
	Language     string `json:"language"`
	ChunkType    string `json:"chunk_type"` // "function", "class", "variable", "import", etc.
}

type Consumer

type Consumer[T any] func(T) error

type GenericParser

type GenericParser struct {
	// contains filtered or unexported fields
}

GenericParser handles parsing of multiple languages

func NewGenericParser

func NewGenericParser() *GenericParser

NewGenericParser creates a new parser with language configurations

func (*GenericParser) ParseFile

func (p *GenericParser) ParseFile(filePath string, sourceCode []byte) ([]Chunk, error)

ParseFile parses a source file and returns chunks

type LanguageConfig

type LanguageConfig struct {
	Language     *sitter.Language
	Queries      map[string]string
	FileExt      string
	LanguageName string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL