From 76456919ae81808e07eeaaecab33a749b83f5ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ibrahim=20Sa=C4=9F=C4=B1ro=C4=9Flu?= Date: Sun, 28 Jul 2024 10:36:06 +0300 Subject: [PATCH] docs: fix tree cursor documentation (#3324) - ts_tree_cursor_current_depth - ts_tree_cursor_reset --- lib/binding_rust/lib.rs | 8 ++++---- lib/include/tree_sitter/api.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index c1d78c1d..3b24a201 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -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) }; diff --git a/lib/include/tree_sitter/api.h b/lib/include/tree_sitter/api.h index d7cd31aa..7a6b247d 100644 --- a/lib/include/tree_sitter/api.h +++ b/lib/include/tree_sitter/api.h @@ -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);