Subject: Re: bug#76788: treesit-thing-settings for elixir-ts-mode

From: Juri Linkov <[email-masked]>
Date: Sun, 20 Apr 2025 20:40:39 +0300

>>> 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

Thanks for elixir/heex indentation tests that revealed one problem,
I fixed it by adapting one query from heex-ts--indent-rules
to elixir-ts--indent-rules:

       ((parent-is "^source$")
        ,(lambda (_node _parent bol &rest _)
           ;; If Elixir is embedded indent to parent
           ;; otherwise indent to the bol.
           (if (treesit-local-parsers-at (point))
               (save-excursion
                 (goto-char (treesit-node-start
                             (treesit-node-at bol 'heex)))
                 (back-to-indentation)
                 (point))
             (pos-bol)))
        ,(lambda (_node _parent _bol &rest _)
           (if (treesit-local-parsers-at (point))
               elixir-ts-indent-offset
             0)))

So now all indentation tests are passed.