diff options
| author | Danny Freeman | 2023-09-15 11:29:05 -0400 |
|---|---|---|
| committer | Yuan Fu | 2023-09-17 21:12:56 -0700 |
| commit | b892da5f615306c04d9d1b2e95954d14e1481752 (patch) | |
| tree | a650430d3169d494b2edd6e6df845cc942be99f1 /exec/exec.c | |
| parent | 9ab8b968d63d9287639bbc574873bf8fde769fea (diff) | |
| download | emacs-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