docs: fix tree cursor documentation (#3324)

- ts_tree_cursor_current_depth
- ts_tree_cursor_reset
This commit is contained in:
ibrahim Sağıroğlu 2024-07-28 10:36:06 +03:00 committed by GitHub
parent f50123a3ec
commit 76456919ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -1545,9 +1545,8 @@ impl<'cursor> TreeCursor<'cursor> {
}
}
/// Get the numerical field id of this tree cursor's current node.
///
/// See also [`field_name`](TreeCursor::field_name).
/// Get the depth of the cursor's current node relative to the original
/// node that the cursor was constructed with.
#[doc(alias = "ts_tree_cursor_current_depth")]
#[must_use]
pub fn depth(&self) -> u32 {
@ -1650,7 +1649,8 @@ impl<'cursor> TreeCursor<'cursor> {
(result >= 0).then_some(result as usize)
}
/// Re-initialize this tree cursor to start at a different node.
/// Re-initialize this tree cursor to start at the original node that the
/// cursor was constructed with.
#[doc(alias = "ts_tree_cursor_reset")]
pub fn reset(&mut self, node: Node<'cursor>) {
unsafe { ffi::ts_tree_cursor_reset(&mut self.0, node.0) };

View file

@ -682,7 +682,8 @@ TSTreeCursor ts_tree_cursor_new(TSNode node);
void ts_tree_cursor_delete(TSTreeCursor *self);
/**
* Re-initialize a tree cursor to start at a different node.
* Re-initialize a tree cursor to start at the original node that the cursor was
* constructed with.
*/
void ts_tree_cursor_reset(TSTreeCursor *self, TSNode node);