tree-sitter / py-tree-sitter

Python bindings to the Tree-sitter parsing library
https://tree-sitter.github.io/py-tree-sitter/
MIT License
817 stars 96 forks source link

parsing, `keep_text` argument deprecated ? #269

Open juanmirocks opened 1 month ago

juanmirocks commented 1 month ago

Currently the keep_text argument is deprecated: https://github.com/tree-sitter/py-tree-sitter/blob/master/tree_sitter/__init__.pyi#L253

What is the reason for that? I ask because I've seen that parsing with keep_text=False makes it several times faster. There are valid occasions to do parsing without wanting to keep the text in the nodes.

If the argument will indeed be removed, what's the replacement? A Callable ?

Incidentally, the public docs do not warn about the deprecation: https://tree-sitter.github.io/py-tree-sitter/classes/tree_sitter.Parser.html

ObserverOfTime commented 1 month ago

Do you have any benchmarks?