-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding Inconsistencies #19
Comments
I also want to add that |
|
in general shouldn't the methods except |
Ah that was it, I wanted the layout to remain the same as the C struct so casting from C pointers would be okay, like here
Yeah, I agree. PR welcome :) none of these methods besides |
I was digging the C api, and if a node is not found they return an empty node, do you think it would make sense to do this in go too instead of returning pointers which could be returning a |
Ah right. I guess we could add an |
After thinking about it a bit more, I think I personally would prefer a This does limit the ability to chain methods returning childs, but how would the current api with |
yeah it would just panic, I'm not really a fan of returning a |
while I would prefer After I spent some time thinking about |
I ran into another issue with the See: #24 |
What about parsers? e.g. |
Maybe something like |
IMO even |
Hi, first of all I appreciate the effort to provide updated & maintained go bindings for tree-sitter.
Previously I was using https://github.com/smacker/go-tree-sitter which I had to fork to get rid of all the included tree-sitter grammars & make major breaking changes to be able to work with it.
My objective is to have good looking syntax highlighting and for this I ported the
highlight
crate of the official tree-sitter rust bindings to go. I had major pain points with missing features with the old module which are now gone.While porting my highlighting code to this module I found 2 things I am wondering about:
github.com/smacker/go-tree-sitter
useduint32
in most places which seem to have been replaced withuint
in this module except for: https://github.com/tree-sitter/go-tree-sitter/blob/master/query.go#L113Is this intended or just an oversight?
From what I can tell the
Node
struct should be passed around as a pointer. There are 3 places where they are handled as values instead which makes dealing with nodes a little bit annoying in those cases:go-tree-sitter/query.go
Line 112 in 5432ade
go-tree-sitter/tree_cursor.go
Line 143 in 5432ade
go-tree-sitter/query.go
Line 809 in 5432ade
Is there also any specific reason this has been done?
Besides this I haven't ran into any issues, thanks for this awesome work!
The text was updated successfully, but these errors were encountered: