]> git.eshelyaron.com Git - emacs.git/commit
New function treesit-parser-changed-ranges
authorYuan Fu <casouri@gmail.com>
Wed, 17 Apr 2024 06:46:39 +0000 (23:46 -0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:10:39 +0000 (14:10 +0300)
commit5cd404bdc6b0d56327bfc98fdec7b817f850a6cb
tree1ca215c53b0ea549b4ee2b906d9bd19857836aab
parent4617591c3dc66ec986af1cd6d811c6bd2fe9fd26
New function treesit-parser-changed-ranges

- Add a new field last_changed_ranges to tree-sitter parser object.
- Add a new function treesit-parser-changed-ranges

* doc/lispref/parsing.texi (Using Parser): Add the function in
tree-sitter manual.
* src/treesit.c (treesit_get_changed_ranges): New function, refactored
out of treesit_call_after_change_functions.
(treesit_call_after_change_functions): Pull out
treesit_get_changed_ranges.
(treesit_ensure_parsed): Save the changed ranges to the parser object.
(make_treesit_parser): Initialize the new parser field
last_changed_ranges.
(Ftreesit_parser_changed_ranges): New function.
(Qtreesit_unparsed_edits): New error.
* src/treesit.h (Lisp_TS_Parser): New field.

(cherry picked from commit 996b9576713f9d63ea7ff7e9630a15cb0a0214eb)
doc/lispref/parsing.texi
etc/NEWS
src/treesit.c
src/treesit.h