class TreeSitter::QueryCursor
- TreeSitter::QueryCursor
- Reference
- Object
Direct Known Subclasses
Defined in:
tree_sitter/query_cursor.crConstructors
-
.new(query : TreeSitter::Query)
Create a new cursor for executing a given query.
Instance Method Summary
-
#exec(node : Node)
Start running a given query on a given node.
-
#exec(node : Node, &)
Start running a given query on a given node.
- #finalize
-
#next_capture : Capture | Nil
Returns the next capture or nil.
- #query : Query
- #query=(query : Query)
-
#set_byte_range(start_byte : UInt32, end_byte : UInt32)
Set the range of bytes in which the query will be executed.
-
#set_point_range(start_row : Int32, start_column : Int32, end_row : Int32, end_column : Int32)
Set the range of row, column positions in which the query will be executed.
-
#set_point_range(start_point : Point, end_point : Point)
Set the range of row, column positions in which the query will be executed.
- #to_unsafe : LibTreeSitter::TSQueryCursor
Constructor Detail
Create a new cursor for executing a given query.
The cursor stores the state that is needed to iteratively search
for matches. To use the query cursor, call QueryCursor#exec
to start running the given query on a given syntax node.
Instance Method Detail
Start running a given query on a given node.
Use #next_capture
to fetch the captures.
Start running a given query on a given node.
Yield the capture name and the node
Set the range of bytes in which the query will be executed.
Set the range of row, column positions in which the query will be executed.
Set the range of row, column positions in which the query will be executed.