LanguageRegistry service manages tree-sitter-based language definitions for syntax highlighting and parsing. Each registry is scoped to a specific language.
Accessing the LanguageRegistry
Registering a language
Register a new tree-sitter language definition:LanguageDescriptor
LanguageGrammarProvider
A fun interface that provides the tree-sitter grammar:LanguageThemeProvider
An optional fun interface for syntax highlighting theme support:QueryProvider
Provides tree-sitter queries for the language:LanguageRegistration
LanguageRegistry methods
CaptureStyle
Generated highlight spans useCaptureStyle to define how tree-sitter nodes are styled:
ColorKey values
Predefined CaptureStyle constants
CaptureStyle provides convenient constants for common styles: