Skip to content

Commit

Permalink
feat: add SyntaxNode#TreeCursor() method
Browse files Browse the repository at this point in the history
  • Loading branch information
nedpals committed Mar 13, 2024
1 parent 5534e94 commit 85e3035
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ func (n SyntaxNode) Query(q string, d ...any) *QueryNodeCursor {
return queryNode2(n, fmt.Sprintf(q, d...))
}

func (n SyntaxNode) TreeCursor() *sitter.TreeCursor {
return sitter.NewTreeCursor(n.Node)
}

func WrapNode(doc *Document, n *sitter.Node) SyntaxNode {
return SyntaxNode{
isTextCached: false,
Expand Down

0 comments on commit 85e3035

Please sign in to comment.