From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_Paulo_Labegalini_de_Carvalho?= Newsgroups: gmane.emacs.devel Subject: Re: Initial fontification in sh-mode with tree-sittter Date: Tue, 29 Nov 2022 14:52:16 -0700 Message-ID: References: <6C8B0F8E-DF61-4BC3-B0D0-56DBB66BE637@gmail.com> <7AE71CCA-6F18-4DE6-8608-7D9B3E9E52FB@gmail.com> <9BA853EA-8B7F-41A0-A174-D86DF5CE7788@gmail.com> <83sfj3cfl0.fsf@gnu.org> <03309451-1AEB-458C-88FD-9715CECC27A2@gmail.com> <83mt9bc9ke.fsf@gnu.org> <8335b19ndr.fsf@gnu.org> <39ECD413-BD10-4BF3-90AC-36F02276607E@gmail.com> <8A2361BB-1081-4550-AC29-B9E99BFC2FB8@gmail.com> <42DBD4F5-71D9-434E-B7B4-4E0FF89F934F@gmail.com> <83edu7mkza.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001432f205eea30171" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16330"; mail-complaints-to="usenet@ciao.gmane.io" To: Eli Zaretskii , emacs-devel@gnu.org, Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 29 22:53:07 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p08XL-00041g-C0 for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Nov 2022 22:53:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p08Wq-0000md-45; Tue, 29 Nov 2022 16:52:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p08Wn-0000ld-NT for emacs-devel@gnu.org; Tue, 29 Nov 2022 16:52:33 -0500 Original-Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p08Wl-00062M-P6; Tue, 29 Nov 2022 16:52:33 -0500 Original-Received: by mail-ej1-x62b.google.com with SMTP id ud5so37051188ejc.4; Tue, 29 Nov 2022 13:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=29kggicEkwPvFSH9yIHb2LZiX1hgZUS8UCN70SJDTFI=; b=Iu/e9eyoBHH3W/n4uS7fXY5UkqMKvyAMxSG0AbOSlO7bIWFNax9DFhAGmpb4Afpp43 daZmIrfoppG7GolWKx+JGhYCrPfHqPA6ijrSAb/AZ+9OVaZhb0S0f5tgCc4FrVus1YFL ascsvCPfGvy2RExKphMNpPH7kptWe5LJ/Yz8KnGZjev4lGH58cwdsIkxe+0b7Y13wB/U t6EDSFCe4/VHtuv2n08f48a9hsezK2SIoKOkF8KNuZ2AEsbFhN5VrUm2Trf47u7ZABzO 7r+bKIw3cnQ8DC0oDYLXBQXVG9cZDM1GG+dtYcbcxc0V4M53ELLzHvkwbO7qYP6fT59l 3IFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=29kggicEkwPvFSH9yIHb2LZiX1hgZUS8UCN70SJDTFI=; b=SH6NOHTB6vl3n0upEPHdbhe80+ZjCMVgComLGKD2rafda/vZ35mqc9sajV9mb/Arxa 1CNApJ7lwq0ukJZYFa140Mzd24p6bgdZ848XFZDb6zevpKbnED+kUE/JoCVxJQZuBmq7 /k0ZCHhXIzk9D8ke2JcJjWke+suYotS3wD59TRM/z+G3i6uA4cwS6frTGB0nogh385hQ PbT1+PPm7IiXN9PKdUFzeYiNJKCH9WX+1vR0g+MtZggRBmt5sFhqM08oWZnp7Uy8owAG w1w555zlbPnR/4sWHX6sroQ45P6X2f04euHa1V3FEsdPA0uZlqcZpby+vd/XotjVRFjh e99w== X-Gm-Message-State: ANoB5plMjCMZnzE9oywBBHRM48BuMWzzixnljn7QMkaOilRHce60srFv ua7nMv0rhSf8hTaA7n4btGOXGFb5MMJTraNc4WZqV/ww X-Google-Smtp-Source: AA0mqf6+AsbwqoWFuUVt7KnNek2qdZXCPyLrFnGUNCRYu5rOMwpQBR/B41GyY+ZOPe0W2VHynDNKZSNMWJRt2/mqbFs= X-Received: by 2002:a17:906:c449:b0:7ae:cbae:af1 with SMTP id ck9-20020a170906c44900b007aecbae0af1mr49664891ejb.31.1669758748732; Tue, 29 Nov 2022 13:52:28 -0800 (PST) In-Reply-To: <83edu7mkza.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=jaopaulolc@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300729 Archived-At: --0000000000001432f205eea30171 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Nov 12, 2022 at 11:23 PM Eli Zaretskii wrote: > > From: Jo=C3=A3o Paulo Labegalini de Carvalho > > Date: Sat, 12 Nov 2022 15:04:26 -0700 > > Cc: Eli Zaretskii , emacs-devel@gnu.org > > > > I see. This is tree-sitter-bash=E2=80=99s problem. When there are only= newlines > between two EOF=E2=80=99s, the parser > > erroneously marks everything that follows as heredoc_body. I tried > tree-sitter=E2=80=99s online demo and it gives > > the same result[1]. We should report this to tree-sitter-bash=E2=80=99= s author. > > > > Sorry for the delay. I confirmed the problem was in the tree-sitter-bas= h > 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. --=20 Jo=C3=A3o Paulo L. de Carvalho Ph.D Computer Science | IC-UNICAMP | Campinas , SP - Brazil Postdoctoral Research Fellow | University of Alberta | Edmonton, AB - Canad= a joao.carvalho@ic.unicamp.br joao.carvalho@ualberta.ca --0000000000001432f205eea30171 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Nov 12, 2022 at 11:23 PM Eli Zare= tskii <eliz@gnu.org> wrote:
> From: Jo=C3=A3o Paulo Labegalini de Carvalho &= lt;jaopaulolc@gma= il.com>
> Date: Sat, 12 Nov 2022 15:04:26 -0700
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>
>=C2=A0 I see. This is tree-sitter-bash=E2=80=99s problem. When there ar= e only newlines between two EOF=E2=80=99s, the parser
>=C2=A0 erroneously marks everything that follows as heredoc_body. I tri= ed tree-sitter=E2=80=99s online demo and it gives
>=C2=A0 the same result[1]. We should report this to tree-sitter-bash=E2= =80=99s author.
>
> Sorry for the delay. I confirmed the problem was in the tree-sitter-ba= sh side and submitted a PR to fix it:
> https://github.com/tree-sitter/tree-sit= ter-bash/pull/137
> Once my fixes are pulled in, there is no change required to my patch.<= br>
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 fix= ing the issue with heredocs just landed. Now the changes that we merged wit= h the great help of Yuan will fontify heredocs correctly with no changes to= sh-script.el.
https://github.com/tree-sitter/tree-sitter-ba= sh/pull/137

I hope to soon find some time to work on = adding indentation, imenu, and more tree-sitter-based features to sh-mode.<= br>
--
Jo=C3=A3o Paulo L. de Carvalho
Ph.D Computer Science | =C2=A0IC-= UNICAMP | Campinas , SP - Brazil
Postdoctoral Research Fellow | Universi= ty of Alberta | Edmonton, AB - Canada
--0000000000001432f205eea30171--