`treesit-parser-set-included-ranges’ appears quite useful for directing tree-sitter’s attention to part of a buffer, for example input at a comint mode’s prompt. But I have noticed that once the included range is set, it remains fixed within the buffer, and does not expand as text is added or removed from that region.
Since tree-sitter incrementally updates the syntax tree as edits occur, I wonder what the “right time” to update the included region with `set-included-ranges’ is? Constantly, say in an after-change-function, or “just-in-time”, as you are about to query the syntax tree for some purpose?
Put another way, does the syntax tree in tree-sitter survive changes to an included range (treating it as an “incremental update”)? Or does explicitly changing the range effectively dump the tree and rebuild it?
|