-
Notifications
You must be signed in to change notification settings - Fork 6
Clone trait of TreeCursor might not be correctedly implemented #33
Comments
After reading wasm-bindgen's guide, I realized that Clone trait is forwarded to inner types. Maybe my error is related to other issues. |
It is actually possible that this is implemented incorrectly. Looking at the I can look into this but if it's implemented incorrectly it will probably require an update to the bindings upstream to expose a proper copy method that we can wrap. |
Many thanks! I will try to provide a minimal reproducible example. |
@Enter-tainer Apologies for the delay in addressing this. I was just recently trying to expose the internal Do you happen to have a small example that demonstrates this behavior? It would be interesting to verify that |
I will have a try this week. Thank you for your help! |
Many thanks to your awesome project!
After adding a dummy implementation to
utf8_text
(see silvanshade/tree-sitter-facade#34). I'm still experiencing errors.After some debugging, I found that I have an invalid TreeCursor, which result in the failure of
TreeCursor.currentNode
.https://docs.rs/web-tree-sitter-sys/0.2.6/src/web_tree_sitter_sys/lib.rs.html#626 says that TreeCursor has clone trait, but it seems that
TreeCursor
has no members. I'm not really familiar with wasm-bindgen. IIRC, the derivedclone()
function will callclone
on every member of the struct. But given that TreeCursor has no members, I guess this will result in an empty clone function. Thus nothing is really cloned when callingTreeCursor::clone
The text was updated successfully, but these errors were encountered: