You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tree-sitter-md = { version = "0.3.2", features = ["parser"] }
Node::walk() does not return a MarkdownCursor. This makes it hard to re-visit nodes.
let cursor : MarkdownCursor= ...
// Save a node to come back toletnode=cursor.node();do_something_with_cursor(&mutcursor);// Error
let re_visit: MarkdownCursor=node.walk();
Proposed solution:
Add struct MarkdownNode as a thin wrapper around Node
Deref lets you use all the methods of Node impl Deref for MarkdownNode { type Target = Node; ... }
Shadow walk to return a MarkdownCursor impl MarkdownNode { fn walk(&self) -> MarkdownCursor { ... } }
Change MarkdownCursor::node to return MarkdownNode. Or add a new method fn markdown_node(&self) -> MarkdownNode
The text was updated successfully, but these errors were encountered:
tree-sitter-md = { version = "0.3.2", features = ["parser"] }
Node::walk()
does not return aMarkdownCursor
. This makes it hard to re-visit nodes.Proposed solution:
struct MarkdownNode
as a thin wrapper aroundNode
Deref
lets you use all the methods ofNode
impl Deref for MarkdownNode { type Target = Node; ... }
walk
to return aMarkdownCursor
impl MarkdownNode { fn walk(&self) -> MarkdownCursor { ... } }
MarkdownCursor::node
to returnMarkdownNode
. Or add a new methodfn markdown_node(&self) -> MarkdownNode
The text was updated successfully, but these errors were encountered: