GNU bug report logs -
#76788
treesit-thing-settings for elixir-ts-mode
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Thu, 6 Mar 2025 18:18:01 UTC
Severity: wishlist
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #39 received at 76788 <at> debbugs.gnu.org (full text, mbox):
>> BTW, I was a surprise that only elixir can embed heex,
>> but not vice versa. So I tried to embed elixir in heex
>> using injections.scm queries from tree-sitter-heex repo:
>
>> #+begin_src emacs-lisp
>> (define-derived-mode heex-ts-mode html-mode "HEEx"
>> ...
>> (setq-local treesit-range-settings
>> (treesit-range-rules
>> :embed 'elixir
>> :host 'heex
>> '((directive [(partial_expression_value)
>> (ending_expression_value)]
>> @cap))
>> :embed 'elixir
>> :host 'heex
>> :local t
>> '((directive (expression_value) @cap)
>> (expression (expression_value) @cap))))
>> #+end_src
>>
>> together with combined treesit-font-lock-settings/feature-list.
>> And these ranges work nicely only separately, but not when combined.
>> So need to investigate more. Maybe will create a new report.
>
> Thanks for this. I kind of forgot about it, sorry about that. It would be
> great if that is possible, but I don't know how that would work though?
Ok, now I added elixir embedding in heex, as well as
elixir->heex->elixir that e.g. highlights '@entries' in:
def unordered_list(assigns) do
~H"""
<ul>
<li :for={entry <- @entries}>{render_slot(@inner_block, entry)}</li>
</ul>
"""
end
that works well.
This bug report was last modified 86 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.