Documentation
¶
Overview ¶
Package extract turns a source file into graph fragments using tree-sitter. Each extractor emits definition nodes (file, function, type, method) plus the structural edges it can see locally (contains, imports). Calls and imports that cross files are recorded raw and stitched together by Resolve, which has the whole-corpus view needed to point a call at the right definition.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Call ¶
type Call struct {
CallerID, Callee, File, Loc string
}
Call is an unresolved call site: CallerID invoked a symbol named Callee.
type Def ¶
type Def struct {
ID, Name, File string
}
Def records a named definition so cross-file calls can resolve to it by name.
type Imp ¶
type Imp struct {
FileID, File, Spec, Loc string
}
Imp is an unresolved import: File imported the module named Spec.
type Result ¶
Result is one file's extraction before cross-file resolution.
func File ¶
File extracts rel (a path relative to root). Unsupported extensions return an empty result, not an error, so the caller can skip them silently.
func FileFromBytes ¶ added in v0.3.0
FileFromBytes extracts rel from already-read source bytes. It lets callers that have hashed the file (e.g. the incremental cache) avoid a second read. Unsupported extensions return an empty result.