Subject: Re: bug#66183: elixir-ts-mode test failure

From: john muhl <[email-masked]>
Date: Mon, 25 Sep 2023 11:01:57 -0500

Yuan Fu <[email-masked]> writes:

>> On Sep 24, 2023, at 9:53 AM, john muhl via Bug reports for GNU
>> Emacs, the Swiss army knife of text editors <[email-masked]>
>> wrote:
>> 
>> The change in 5cba5ee8905 caused an elixir test to start failing. The
>> white space at the start of the test is now in a heex range so pressing
>> tab there matches a heex rule instead of the elixir one. Moving the
>> dummy range to the end fixes the test.
>
> Thank you. I’ll make sure to remember also running elixir tests when I
> make a change.
>
> I looked around and found elixir-mode’s language-at-point function
> works in a way that isn’t what tree-sitter functions expect.
> Tree-sitter functions expect the major mode to derive language at
> point by querying the host language and do some pattern matching,
> rather than using language parser’s range. I took a quick look at
> elixir’s grammar and came up with this version for a POC. You probably
> need to adjust it but the idea is there.

Thanks for checking. Actually I was just looking at why the tests were
failing but now see that I forgot to include the elixir mode maintainer.

> With the new language-at-point definition, treesit-language-at can
> return the correct language, and the test passes again.

Wilhelm could you have a look?