haskell-tree-sitter icon indicating copy to clipboard operation
haskell-tree-sitter copied to clipboard

ts_node_string is not bridged

Open Ilham-Habibullin opened this issue 6 years ago • 4 comments

Can't peek Tree from Ptr since Tree does not implement Storable typeclass. Is there some other proper way to do it? I am pretty new in Haskell so it might be my fail. Sorry if it is.

Ilham-Habibullin avatar Aug 18 '19 23:08 Ilham-Habibullin

If I recall correctly, all of the API which uses Trees actually takes Ptr Tree. Thus, there’s no real value in copying a Tree using Storable since the only thing you could do with it is write it back out to C memory using poke and then pass the resulting pointer around to existing API.

If you describe what you’re trying to accomplish with the Tree, we can probably advise you on the best way to use the API.

robrix avatar Aug 19 '19 07:08 robrix

I wanted to print it, to see how the whole Tree is look like. Right now i have discovered that i suppose to do it with root node, but i can't find function called ts_node_string which is provided with original library.

Ilham-Habibullin avatar Aug 19 '19 22:08 Ilham-Habibullin

@IlhamKhabibullin: Yes, we don’t currently bridge that function; I’ve no objection to doing so, however!

robrix avatar Aug 22 '19 11:08 robrix

Edited the issue title to note that ts_node_string is not currently bridged.

robrix avatar Aug 30 '19 14:08 robrix