Add ts_tree_cursor_goto_first_child_for_byte method

Atom needs this for efficiently seeking to the leaf node at a given position,
visiting all of its ancestors along the way.
This commit is contained in:
Max Brunsfeld 2018-05-16 13:50:53 -07:00
parent 89b3a6a059
commit ebddb1a0b5
3 changed files with 102 additions and 0 deletions

View file

@ -122,6 +122,7 @@ TSNode ts_node_named_descendant_for_point_range(TSNode, TSPoint, TSPoint);
TSTreeCursor *ts_tree_cursor_new(const TSTree *);
void ts_tree_cursor_delete(TSTreeCursor *);
bool ts_tree_cursor_goto_first_child(TSTreeCursor *);
int64_t ts_tree_cursor_goto_first_child_for_byte(TSTreeCursor *, uint32_t);
bool ts_tree_cursor_goto_next_sibling(TSTreeCursor *);
bool ts_tree_cursor_goto_parent(TSTreeCursor *);
TSNode ts_tree_cursor_current_node(TSTreeCursor *);