Documentation
¶
Index ¶
Constants ¶
const ParseTimeoutMicros = 10_000_000
ParseTimeoutMicros is the default per-file parse timeout (10 seconds).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Call ¶
type Call struct {
CalleeName string
EnclosingFuncQN string
DispatchKind string
// CalleeIsLocallyBound: a bare call whose callee is a parameter of an
// enclosing function; the resolver must not bind it to a project symbol.
CalleeIsLocallyBound bool
}
Call represents a raw call site (callee name + enclosing function).
DispatchKind labels calls synthesized by an indirect-dispatch pattern rather than appearing literally in source. Empty for ordinary direct calls. Set by the C extractor on:
- "executor_submit" : <pool>.submit(fn, ...) — concurrent.futures
- "depends" : FastAPI Depends(fn)
- "getattr" : getattr(obj, "method")(...)
Consumed by the pipeline to label the resulting CALLS edge with properties.dispatch_kind + properties.confidence so trace_call_path can distinguish direct from indirect resolutions for confidence-band calculation.
type CrossFileDef ¶
type CrossFileDef struct {
QualifiedName string
ShortName string
Label string // "Function", "Method", "Type", "Interface"
ReceiverType string // for methods: receiver type QN
DefModuleQN string // module QN where this def lives
ReturnTypes string // "|"-separated return type texts (e.g., "*File|error")
EmbeddedTypes string // "|"-separated embedded type QNs
FieldDefs string // "|"-separated "name:type" pairs (for struct fields, e.g. "Binder:Binder|Name:string")
MethodNames string // "|"-separated method names for interfaces (e.g. "Get|Put|Delete")
IsInterface bool
}
CrossFileDef represents a definition from another file for cross-file LSP resolution.
func DefsToLSPDefs ¶
func DefsToLSPDefs(defs []Definition, moduleQN string) []CrossFileDef
DefsToLSPDefs converts file-local Definition slice to CrossFileDef format.
type Definition ¶
type Definition struct {
Name string
QualifiedName string
Label string // "Function", "Method", "Class", "Variable", "Module", "Interface", "Enum", "Type"
FilePath string
StartLine int
EndLine int
Signature string
ReturnType string
Receiver string
Docstring string
ParentClass string
Decorators []string
BaseClasses []string
ExtendsTypes []string
ImplementsTypes []string
ParamNames []string
ParamTypes []string
ReturnTypes []string
Complexity int
Lines int
IsExported bool
IsAbstract bool
IsTest bool
IsEntryPoint bool
}
Definition represents a function/class/variable/module extracted from source.
type FileResult ¶
type FileResult struct {
Definitions []Definition
Calls []Call
Imports []Import
Usages []Usage
Throws []Throw
ReadWrites []ReadWrite
TypeRefs []TypeRef
EnvAccesses []EnvAccess
TypeAssigns []TypeAssign
ImplTraits []ImplTrait
ResolvedCalls []ResolvedCall
ModuleQN string
IsTestFile bool
ImportCount int
// DepthCapped is true when an AST walk hit the recursion ceiling and
// skipped a subtree; the file was indexed partially rather than crashing.
DepthCapped bool
}
FileResult holds the extraction results from one file.
func ExtractFile ¶
func ExtractFile(source []byte, language lang.Language, project, relPath string) (*FileResult, error)
ExtractFile runs the C extraction library on one file. source is the file content, language is the programming language, project and relPath are used for qualified name computation.
type ProfileStats ¶
ProfileStats holds accumulated profiling data from C extraction.
func GetProfile ¶
func GetProfile() ProfileStats
GetProfile returns accumulated parse/extraction timing and resets counters.
type ResolvedCall ¶
type ResolvedCall struct {
CallerQN string
CalleeQN string
Strategy string
Confidence float32
Reason string // diagnostic label for unresolved calls (empty if resolved)
}
ResolvedCall represents a high-confidence type-aware call resolution from LSP.
func RunGoLSPCrossFile ¶
func RunGoLSPCrossFile( source []byte, moduleQN string, fileDefs []CrossFileDef, crossDefs []CrossFileDef, imports []Import, ) []ResolvedCall
RunGoLSPCrossFile runs the Go LSP type resolver with cross-file definitions. source is the file content, moduleQN is the file's module QN, fileDefs are the file's own definitions (converted to CrossFileDef format), crossDefs are definitions from imported packages, imports are the file's import mappings. Returns resolved calls with high confidence.
type TypeAssign ¶
TypeAssign represents a variable assignment where RHS is a constructor call.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package isolate runs tree-sitter extraction in supervised worker processes so a crashing or hanging file is skipped and reported instead of taking the whole indexer (and the MCP server around it) down.
|
Package isolate runs tree-sitter extraction in supervised worker processes so a crashing or hanging file is skipped and reported instead of taking the whole indexer (and the MCP server around it) down. |