GNU bug report logs - #76788
treesit-thing-settings for elixir-ts-mode

Previous Next

Package: emacs;

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 #21 received at 76788 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Wilhelm Kirschbaum <wkirschbaum <at> gmail.com>
Cc: 76788 <at> debbugs.gnu.org
Subject: Re: bug#76788: treesit-thing-settings for elixir-ts-mode
Date: Tue, 15 Apr 2025 20:30:34 +0300
>     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?

Because otherwise there is no easy way to navigate to the function name
and its arguments.  There were many complaints that unlike smie-based sexp
now tree-sitter jumps too far directly to the end of functions.
So sadly an idealistic promise of tree-sitter doesn't fit perfectly
into the real world.

For many years I used elixir-mode before switching to elixir-ts-mode.
And it caused a minor disruption by the inability to move to the
function name and arguments as before in elixir-mode.

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

The new command 'treesit-cycle-sexp-type' keeps this advantage
while allowing the users to toggle the traditional behavior
where C-M-f moves over the arguments.

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

This is still possible with 'treesit-cycle-sexp-type'.




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.