emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call for volunteers: add tree-sitter support to major modes


From: João Paulo Labegalini de Carvalho
Subject: Re: Call for volunteers: add tree-sitter support to major modes
Date: Fri, 21 Oct 2022 10:47:33 -0600

I have finally got some time to work on this.

>From my initial understanding of `sh-script-mode' is that it supports many shell scripting languages via an elegant "inheritance" structured code.

As part of the tree-sitter project, I only found a repo to generate the parser for bash. So it is my impression that other shell languages might not be correctly parsed by tree-sitter-bash from here: https://github.com/tree-sitter/tree-sitter-bash.

My idea to incrementally add support for shell languages is to start with bash and setup three `tree-sitter-font-lock-rules' for it, like so:

(defvar sh-script--treesit-settings
    (treesit-font-lock-rules
        :language 'bash
        :feature 'basic
        ;; queries for 'basic feature here
        :language 'bash
        :feature 'moderate
        ;; queries for 'moderate feature here
        :language 'bash
        :feature 'full
        ;; queries for 'full feature here))

Would that be acceptable? Or should I use a function in the `language:' field that returns a shell language symbol?

On Wed, Oct 12, 2022 at 9:36 AM Eli Zaretskii <eliz@gnu.org> wrote:
> From: João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com>
> Date: Wed, 12 Oct 2022 09:09:26 -0600
> Cc: emacs-devel@gnu.org
>
> On Tue, Oct 11, 2022 at 11:43 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
>  What and how we should handle the C and derived modes is currently
>  under discussion.  So if you could start with shell-script-mode,
>  that'd be ideal, I think.
>
> For sure. I will start working on shell-script-mode.

Thanks!


--
João Paulo L. de Carvalho
Ph.D Computer Science |  IC-UNICAMP | Campinas , SP - Brazil
Postdoctoral Research Fellow | University of Alberta | Edmonton, AB - Canada
joao.carvalho@ic.unicamp.br
joao.carvalho@ualberta.ca

reply via email to

[Prev in Thread] Current Thread [Next in Thread]