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
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On Mon, Apr 14, 2025 at 7:08 PM Juri Linkov <juri <at> linkov.net> wrote:
> > I just tested the latest changes and the forward-sexp is not working
> > correctly. I will look at the changes when I have a minute.
>
> Previously C-M-f jumped from "def" to "end":
>
Yes, this is desired. The expression starts with "def" and the do -> end is
just an argument to the "def" macro.
>
> def fun(a) do
> end
>
> The change is to jump only from "do" to "end" like in other ts-modes.
>
Why is this better? The one huge advantage that elixir-ts-mode brought to
the table was to navigate between functions, the existing elixir-mode could
not get this right.
Before the changes it is possible to navigate or kill the next x functions,
now it is unpredictable. The Elixir grammar is a bit more complicated than
most other languages unfortunately.
>
> To keep jumping from "def" to "end" a possible change is to add
>
> (or (and "\\`call\\'" ,#'elixir-ts--defun-p)
>
> to the 'list' thing in 'treesit-thing-settings'.
>
It's not just for the "def" to "end" this change breaks forward-sexp for
function calls, case blocks etc...
>
> But there is a new command 'treesit-cycle-sexp-type'
> that switches from jumping "do"->"end" to "def"->"end".
>
I don't see any scenario where this will be useful to navigate Elixir code.
Apologies, I see I replied to you directly and not to the thread. Added
the thread again.
[Message part 2 (text/html, inline)]
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.