[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mo
From: |
Yuan Fu |
Subject: |
Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter) |
Date: |
Tue, 13 Dec 2022 10:56:42 -0800 |
> On Dec 13, 2022, at 10:48 AM, João Paulo Labegalini de Carvalho
> <jaopaulolc@gmail.com> wrote:
>
>
> On Tue, Dec 13, 2022 at 11:07 AM Yuan Fu <casouri@gmail.com> wrote:
> Treesit--navigate-defun should, as you did in bash-ts-mode, only navigate in
> the same level (siblings) or higher (parents). Could you show an example of
> the unexpected behavior?
>
> I must have forgotten to evaluate something on my setup file. It is indeed
> working as you described. Sorry for the noise.
>
> Should I add key bindings to use the new tree-sitter navigation functions to
> bash-ts-mode or is it planned an integration with beginning/end-of-defun?
I will repurpose two functions, treesit-beginning-of-defun/end, and make
treesit-major-mode-setup set them up automatically. I’m thinking about
remapping beginning/end-of-defun to their tree-sitter counterparts in
(current-local-map), in treesit-major-mode-setup. That way major modes don’t
need to explicitly bind tree-sitter functions in their keymaps. Stefan, would
that be a good idea?
So if everything goes as planned, bash-ts-mode only needs to set
treesit-defun-type-regexp.
Yuan
- Re: Code navigation for sh-mode with Tree-sitter, (continued)
- New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), Yuan Fu, 2022/12/13
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), João Paulo Labegalini de Carvalho, 2022/12/13
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), Eli Zaretskii, 2022/12/13
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), João Paulo Labegalini de Carvalho, 2022/12/13
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), Yuan Fu, 2022/12/13
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), João Paulo Labegalini de Carvalho, 2022/12/13
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter),
Yuan Fu <=
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), João Paulo Labegalini de Carvalho, 2022/12/13
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), Yuan Fu, 2022/12/15
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), João Paulo Labegalini de Carvalho, 2022/12/16
- Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter), Yuan Fu, 2022/12/17
- Re: Code navigation for sh-mode with Tree-sitter, Yuan Fu, 2022/12/06