emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tree-sitter, using treesit-range-rules for embedded languages


From: Wilhelm
Subject: Tree-sitter, using treesit-range-rules for embedded languages
Date: Tue, 22 Nov 2022 19:24:13 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]