emacs-devel
[Top][All Lists]
Advanced

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

Re: Initial fontification in sh-mode with tree-sittter


From: João Paulo Labegalini de Carvalho
Subject: Re: Initial fontification in sh-mode with tree-sittter
Date: Tue, 29 Nov 2022 14:52:16 -0700

On Sat, Nov 12, 2022 at 11:23 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: João Paulo Labegalini de Carvalho <jaopaulolc@gmail.com>
> Date: Sat, 12 Nov 2022 15:04:26 -0700
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>
>  I see. This is tree-sitter-bash’s problem. When there are only newlines between two EOF’s, the parser
>  erroneously marks everything that follows as heredoc_body. I tried tree-sitter’s online demo and it gives
>  the same result[1]. We should report this to tree-sitter-bash’s author.
>
> Sorry for the delay. I confirmed the problem was in the tree-sitter-bash side and submitted a PR to fix it:
> https://github.com/tree-sitter/tree-sitter-bash/pull/137
> Once my fixes are pulled in, there is no change required to my patch.

Do we need to wait for their fix, or can we have code that will start
working correctly when they fix the parser?


My PR to tree-sitter-bash fixing the issue with heredocs just landed. Now the changes that we merged with the great help of Yuan will fontify heredocs correctly with no changes to sh-script.el.
https://github.com/tree-sitter/tree-sitter-bash/pull/137

I hope to soon find some time to work on adding indentation, imenu, and more tree-sitter-based features to sh-mode.

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