aboutsummaryrefslogtreecommitdiffstats
path: root/exec/exec.c
diff options
context:
space:
mode:
authorDanny Freeman2023-09-15 11:29:05 -0400
committerYuan Fu2023-09-17 21:12:56 -0700
commitb892da5f615306c04d9d1b2e95954d14e1481752 (patch)
treea650430d3169d494b2edd6e6df845cc942be99f1 /exec/exec.c
parent9ab8b968d63d9287639bbc574873bf8fde769fea (diff)
downloademacs-b892da5f615306c04d9d1b2e95954d14e1481752.tar.gz
emacs-b892da5f615306c04d9d1b2e95954d14e1481752.zip
Offset ranges before applying embedded tree-sitter parser
This feature would allow treesitter major modes to easily specify offsets when using embeded parsers. A potential use case for this is javascript template strings, when we want to apply a different parser to the string's contents, but do not want to include the template string's delimiters. * lisp/treesit.el (treesit-query-range): Accept an optional offest arg, apply the offset to all returned ranges. (treesit-range-rules): Accept an optional :offset keyword arg to adjust ranges an embded parser is applied to. (treesit-update-ranges): Forward optional :offset setting from `treesit-range-rules' to `treesit-query-rang'. * test/lisp/treesit-tests.el (treesit-range-offset): Tests the new offset functionality.
Diffstat (limited to 'exec/exec.c')
0 files changed, 0 insertions, 0 deletions