TreeSitter::QueryCursor
Inherits Reference / Object
Constructors
new(query : TreeSitter::Query)
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 methods
each_capture
Sourceexec(node : Node)
Start running a given query on a given node.
Use #next_capture to fetch the captures.
exec(node : Node, &)
Start running a given query on a given node.
Yield the capture name and the node
finalize
Sourcequery
Sourcequery=(query : Query)
Sourceset_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
Source