Documentation
¶
Overview ¶
Package tspool provides tree-sitter parsers for concurrent parsing.
This package centralizes parser management to:
- Provide consistent parser creation across components
- Ensure thread-safe language initialization
Note: Parser pooling is disabled due to tree-sitter cancellation flag issues. When a context is cancelled during ParseCtx, the parser's internal cancel flag is set but not properly reset, causing subsequent parses to fail with "operation limit was hit". Creating fresh parsers avoids this issue.
Thread-safety: Parsers returned by Get are NOT safe for concurrent use. Each goroutine must Get its own parser or use the Parse helper.
Index ¶
Constants ¶
const MaxTreeDepth = 1000
MaxTreeDepth is the maximum recursion depth when walking AST trees.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns a parser for the given language. The returned parser is NOT safe for concurrent use. Caller MUST call parser.Close() when done to free resources.
func GetLanguage ¶
GetLanguage returns the tree-sitter language for the given domain language.
Types ¶
This section is empty.