Tree-sitter: Support callbacks that return String instead of slice in Rust binding

Created on 10 Jul 2019  路  4Comments  路  Source: tree-sitter/tree-sitter

I'm writing a dynamic module for Emacs that exposes tree-sitter functionalities.

A dynamic module in Emacs can only access a buffer's text through String copies (of sub-ranges). It cannot access the internal data structure through &[u8].

Can we add a new parse function to support this use case?

feature_request

Most helpful comment

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.93. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 4 comments

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.93. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

I made a prototype using a new Input trait here.

Hey, sorry for the slow turnaround. I've generalized parse_with and parse_utf16_with to take anything implementing AsRef.

Cool, thanks!

Was this page helpful?
0 / 5 - 0 ratings