Documentation
¶
Overview ¶
Package parsers provides a registry for language-specific parser plugins. Parsers extract metadata and chunk code for various programming languages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPluginNotFound = errors.New("language plugin not found")
ErrPluginNotFound is returned when a plugin is not found
Functions ¶
This section is empty.
Types ¶
type ParserRegistry ¶
type ParserRegistry interface {
// RegisterParser adds a new parser plugin to the registry.
RegisterParser(plugin schema.ParserPlugin) error
// GetParser returns the parser for the given language name.
GetParser(language string) (schema.ParserPlugin, error)
// GetParserForFile returns the appropriate parser for the given file.
GetParserForFile(path string, info fs.FileInfo) (schema.ParserPlugin, error)
// GetParserForExtension returns the parser for the given file extension.
GetParserForExtension(ext string) (schema.ParserPlugin, error)
// GetAllParsers returns all registered parsers.
GetAllParsers() []schema.ParserPlugin
}
ParserRegistry tracks registered language plugins and provides methods to look up parsers by language, file path, or extension.
func NewRegistry ¶
func NewRegistry(logger *slog.Logger) ParserRegistry
NewRegistry creates a new language plugin registry
func RegisterLanguagePlugins ¶
func RegisterLanguagePlugins(logger *slog.Logger) (ParserRegistry, error)
RegisterLanguagePlugins initializes and populates a language registry with all built-in parser plugins (Go, TypeScript, Markdown, JSON, YAML, etc.).
Click to show internal directories.
Click to hide internal directories.