GNU bug report logs -
#78503
30.0.92; tree-sitter elixir-ts-mode structural movement broken
Previous Next
Full log
View this message in rfc822 format
> 1.) `defmodule` is considered a function definition and so moving up
> from the first
> actual function definition `def my_fun do` causes the point to jump to
> 'defmodule my_mod do'. Invoking `end-of-defun` jumps to the end of
> the defmodule block.
> Effectively, you have been ejected from the module body.
>
> ;; current scoped workaround
> ;; does not jump up to defmodule when using `beginning-of-defun`
> (defun elixir-ts--defun-p (node)
> "Return non-nil when NODE is a defun."
> (member (treesit-node-text
> (treesit-node-child-by-field-name node "target"))
> (append
> (remove "defmodule" elixir-ts--definition-keywords)
> elixir-ts--test-definition-keywords)))
>
> It is not ideal to be ejected from the module body and was not the initial
> desired behaviour. modules can be nested and there can be multiple in a
> single file, so not being able to navigate with C-M-a is less ideal imo. I
> remember trying to solve this issue in the early days of treesit.el, but it
> became too complex, perhaps there is an easier way now?
An easier way is proposed above with (remove "defmodule" elixir-ts--definition-keywords).
This bug report was last modified 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.