Documentation
¶
Overview ¶
Package pyextract is the per-language tree-sitter extraction provider for Python. Mirrors goextract / tsextract: constructor-injected GrammarRegistry, embedded queries.scm, no init() registration.
Index ¶
- func NewProvider(grammars *treesitter.GrammarRegistry) extract.Provider
- type Provider
- func (p *Provider) Extensions() []string
- func (p *Provider) Extract(ctx context.Context, source []byte, file extract.SourceFile) (*extract.ExtractedFile, error)
- func (p *Provider) Language() string
- func (p *Provider) Queries() string
- func (p *Provider) SupportsLSPEnrichment() bool
- func (p *Provider) TreeSitterLanguage() *tree_sitter.Language
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
func NewProvider(grammars *treesitter.GrammarRegistry) extract.Provider
NewProvider compiles the embedded queries against the injected GrammarRegistry's "python" grammar. Panics on missing grammar or query compile failure.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the concrete Python extraction provider.
func (*Provider) Extensions ¶
func (*Provider) Extract ¶
func (p *Provider) Extract(ctx context.Context, source []byte, file extract.SourceFile) (*extract.ExtractedFile, error)
Extract parses the source bytes and returns an ExtractedFile per the Phase 59 P02 fact contract. Decorator presence is captured as a reference, NOT folded into the symbol's stable-ID input — Python decorator add/remove preserves ID per CONTEXT.md D-03.
func (*Provider) SupportsLSPEnrichment ¶
func (*Provider) TreeSitterLanguage ¶
func (p *Provider) TreeSitterLanguage() *tree_sitter.Language