Documentation
¶
Index ¶
- func ExtractAll(root string, filePaths []string) (*graph.Extraction, error)
- func ExtractFile(filePath string) (*graph.Extraction, error)
- func ExtractFiles(filePaths []string) (map[string]*graph.Extraction, []error)
- func ResolveCrossFileImports(extractions map[string]*graph.Extraction) []graph.Edge
- func SupportedExtensions() []string
- type ExtraWalkFn
- type ImportHandler
- type LanguageConfig
- type RawEdge
- type RawNode
- type Walker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAll ¶
func ExtractAll(root string, filePaths []string) (*graph.Extraction, error)
ExtractAll runs the full extraction pipeline: 1. Extract each file in parallel 2. Resolve cross-file imports 3. Merge into single extraction
func ExtractFile ¶
func ExtractFile(filePath string) (*graph.Extraction, error)
ExtractFile extracts nodes and edges from a single code file.
func ExtractFiles ¶
func ExtractFiles(filePaths []string) (map[string]*graph.Extraction, []error)
ExtractFiles extracts from multiple code files in parallel.
func ResolveCrossFileImports ¶
func ResolveCrossFileImports(extractions map[string]*graph.Extraction) []graph.Edge
ResolveCrossFileImports creates edges between nodes across files by resolving import statements to actual class/function definitions.
func SupportedExtensions ¶
func SupportedExtensions() []string
SupportedExtensions returns all supported file extensions.
Types ¶
type ExtraWalkFn ¶
ExtraWalkFn handles language-specific node types not covered by the generic walker. Returns true if the node was handled (skip default recursion).
type ImportHandler ¶
ImportHandler extracts import edges from an import AST node.
type LanguageConfig ¶
type LanguageConfig struct {
Language *sitter.Language
ClassTypes []string
FunctionTypes []string
ImportTypes []string
CallTypes []string
NameField string // default: "name"
NameFallbackChildTypes []string
BodyField string // default: "body"
BodyFallbackChildTypes []string
CallFunctionField string // default: "function"
CallAccessorNodeTypes []string
CallAccessorField string // default: "attribute"
FunctionBoundaryTypes []string
FunctionLabelParens bool // default: true
ImportHandler ImportHandler
ExtraWalkFn ExtraWalkFn
}
LanguageConfig defines how to extract nodes/edges from a specific language's AST.
func GetLanguageConfig ¶
func GetLanguageConfig(filePath string) *LanguageConfig
GetLanguageConfig returns the config for a file extension, or nil.
type RawEdge ¶
type RawEdge struct {
Source string
Target string
Relation string
Confidence string
Score float64
File string
Line int
}
RawEdge is an edge extracted from AST before final processing.
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker traverses a tree-sitter AST and extracts nodes and edges.