Putting point at the end of the line of code and calling either (tsc-node-byte-range (tree-sitter-node-at-point)) or (tsc-node-byte-range (tsc-get-descendant-for-position-range (tsc-root-node tree-sitter-tree) (point) (point))) yields (1 . 9) or the module block range and not (9 . 9) as expected.
IIRC, tree-sitter disallows zero-length rules, and has a generation-time check for this. This looks like a bug in either the (CLI) generator, or in tree-sitter-python.
First of all, great package!
Consider the following Python example:
And the following tree:
Putting point at the end of the line of code and calling either
(tsc-node-byte-range (tree-sitter-node-at-point))
or(tsc-node-byte-range (tsc-get-descendant-for-position-range (tsc-root-node tree-sitter-tree) (point) (point)))
yields(1 . 9)
or the module block range and not(9 . 9)
as expected.Is this a bug or a quirk in tree-sitter?