Documentation
¶
Index ¶
- type Match
- type Node
- type Position
- type TreeSitter
- func (ts *TreeSitter) Cleanup()
- func (ts *TreeSitter) FindFunctionCalls(tree *sitter.Tree, functionNames []string, sourceCode []byte) []Match
- func (ts *TreeSitter) FindImports(tree *sitter.Tree, importPatterns []string, sourceCode []byte) []Match
- func (ts *TreeSitter) GetNodeInfo(node *sitter.Node, sourceCode []byte) map[string]interface{}
- func (ts *TreeSitter) GetSupportedLanguages() []string
- func (ts *TreeSitter) ParseToTree(sourceCode string, language string) (*sitter.Tree, error)
- func (ts *TreeSitter) Query(tree *sitter.Tree, pattern string, sourceCode []byte) []Match
- func (ts *TreeSitter) SupportsLanguage(language string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
Node represents an AST node
func FindNodesByType ¶
FindNodesByType finds all nodes of a specific type
func GetNodeAtPosition ¶
GetNodeAtPosition finds the node at the given position
func GetNodePath ¶
GetNodePath returns the path from root to the given node
type TreeSitter ¶
type TreeSitter struct {
}
TreeSitter provides AST parsing capabilities using tree-sitter
func NewTreeSitter ¶
func NewTreeSitter() *TreeSitter
NewTreeSitter creates a new TreeSitter instance
func (*TreeSitter) Cleanup ¶
func (ts *TreeSitter) Cleanup()
Cleanup cleans up resources - no longer needed since we don't store parsers
func (*TreeSitter) FindFunctionCalls ¶
func (ts *TreeSitter) FindFunctionCalls(tree *sitter.Tree, functionNames []string, sourceCode []byte) []Match
FindFunctionCalls finds function calls in the AST
func (*TreeSitter) FindImports ¶
func (ts *TreeSitter) FindImports(tree *sitter.Tree, importPatterns []string, sourceCode []byte) []Match
FindImports finds import statements in the AST
func (*TreeSitter) GetNodeInfo ¶
func (ts *TreeSitter) GetNodeInfo(node *sitter.Node, sourceCode []byte) map[string]interface{}
GetNodeInfo returns detailed information about a node
func (*TreeSitter) GetSupportedLanguages ¶
func (ts *TreeSitter) GetSupportedLanguages() []string
GetSupportedLanguages returns a list of supported languages
func (*TreeSitter) ParseToTree ¶
ParseToTree parses source code and returns a tree-sitter Tree for querying Creates a new parser instance for each call to ensure thread safety
func (*TreeSitter) SupportsLanguage ¶
func (ts *TreeSitter) SupportsLanguage(language string) bool
SupportsLanguage checks if a language is supported