Documentation
¶
Overview ¶
Package lang defines the language adapter contract and the adapter registry. The core (indexer, storage, MCP server) talks to languages exclusively through this interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExtractOptions ¶
type ExtractOptions struct {
// SkipRefs disables reference/call-edge extraction (symbols and
// inheritance only). Used for vendor code: its declarations are
// needed to resolve project hierarchies, but its internal call
// graph is noise.
SkipRefs bool
// Modules maps root-relative directories to module/package names
// (Go: go.mod roots -> module path; later TS: package.json roots).
// Adapters use it to build import-path based FQNs.
Modules map[string]string
}
ExtractOptions tunes per-file extraction.
type Language ¶
type Language interface {
// ID is the stable language identifier used in symbol IDs ("php").
ID() string
// Extensions lists file extensions handled by this adapter,
// with leading dot (".php").
Extensions() []string
// ExtractFile parses src and returns the normalized file index.
// path is used only for reporting; implementations must not read
// from disk.
ExtractFile(path string, src []byte, opts ExtractOptions) (*model.FileIndex, error)
}
Language is implemented once per supported language (php, ts, go, ...).