all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tree-sitter, using treesit-range-rules for embedded languages
@ 2022-11-22 17:24 Wilhelm
  2022-11-22 19:28 ` Yuan Fu
  0 siblings, 1 reply; 5+ messages in thread
From: Wilhelm @ 2022-11-22 17:24 UTC (permalink / raw)
  To: emacs-devel

Is there perhaps an example using treesit-range-rules? To following
attempt to set treesit-range-settings does not seem to have the desired
effect.

(defvar heex--treesit-range-rules
  (treesit-range-rules
   :embed 'elixir
   :host 'heex
   '((directive (partial_expression_value) @cap)
     (directive (expression_value) @cap)
     (expression (expression_value) @cap))))

(setq-local treesit-range-settings heex--treesit-range-rules)

The following error also pops up when modifying the buffer when removing
buffer content:

Error during redisplay: (jit-lock-function 1) signaled
(treesit-range-invalid "RANGE is either overlapping, out-of-order or
out-of-range" ((11 . 20)))

The full attempt is here: https://github.com/wkirschbaum/elixir-mode/blob/main/heex-mode.el



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-23  7:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-22 17:24 Tree-sitter, using treesit-range-rules for embedded languages Wilhelm
2022-11-22 19:28 ` Yuan Fu
2022-11-22 19:52   ` Wilhelm Hugo Kirschbaum
2022-11-22 20:39     ` Yuan Fu
2022-11-23  7:12       ` Wilhelm Kirschbaum

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.