lang

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Register

func Register(l Language)

Register makes an adapter available to the core. Called from the adapter's init() or explicitly at startup.

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, ...).

func ForPath

func ForPath(path string) Language

ForPath returns the adapter responsible for the given file, or nil.

Jump to

Keyboard shortcuts

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