From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jimmy Wong Newsgroups: gmane.emacs.bugs Subject: bug#63086: 29.0.90; go-ts-mode treesit-query-error during jit-lock Date: Thu, 27 Apr 2023 07:36:25 +0100 Message-ID: <4fd042a7-45ae-493e-8c73-680b7678920c@Spark> References: <83r0s7szfj.fsf@gnu.org> <077666b3-657b-4b35-b271-78d6bd26d2df@Spark> <80fa402e-058b-4144-ab1e-a7dd6301bb4d@Spark> <83edo6u5kj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="644a17ee_793b2fcb_d3e2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39603"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 63086@debbugs.gnu.org, casouri@gmail.com To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 27 08:37:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1prvFp-000A7T-D4 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Apr 2023 08:37:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prvFa-0002vZ-5q; Thu, 27 Apr 2023 02:37:06 -0400 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 1prvFX-0002u5-H2 for bug-gnu-emacs@gnu.org; Thu, 27 Apr 2023 02:37:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prvFW-0007sm-T4 for bug-gnu-emacs@gnu.org; Thu, 27 Apr 2023 02:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prvFW-00038g-CJ for bug-gnu-emacs@gnu.org; Thu, 27 Apr 2023 02:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jimmy Wong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Apr 2023 06:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63086 X-GNU-PR-Package: emacs Original-Received: via spool by 63086-submit@debbugs.gnu.org id=B63086.168257740212038 (code B ref 63086); Thu, 27 Apr 2023 06:37:02 +0000 Original-Received: (at 63086) by debbugs.gnu.org; 27 Apr 2023 06:36:42 +0000 Original-Received: from localhost ([127.0.0.1]:57450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prvFB-000386-Qm for submit@debbugs.gnu.org; Thu, 27 Apr 2023 02:36:42 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:60460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prvF8-00037n-Ou for 63086@debbugs.gnu.org; Thu, 27 Apr 2023 02:36:41 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-2f939bea9ebso7338402f8f.0 for <63086@debbugs.gnu.org>; Wed, 26 Apr 2023 23:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682577393; x=1685169393; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=g85qZ1FvMG6faqprSy0FLzTopYNNuYvps+WJXcZIAvo=; b=H3mp8QNfFMKhTSl9o0FFoWmio21OKNKdplgu15b8gAovXh3au8CSpZT47ZqrlmCFI3 8dBAUtuO2wP7cTxFDJi/GNNQ0JF2ThF6ITkZhDgRDjBspvryVALX/Yi/c08IqTRKZdoU 6XdsPsOVHIDZ2PoousrEbHjGz5/dIcZQaIjyrJm48m2kJtDIHUq6icjrVJ9D48tDUA5t mkXk6opqekbSJpxHSDJFMMO9KRd+vBa1erUZzvJo5Y9lkdmoezDqGJm87kttC6O5q6Jv 0ZJI6ms7HJMiz6PezFIum99KL1hl5PsrSJdZ9B0b1gwweHmvKwccLk/XPX9l2u3Ya31P LSJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682577393; x=1685169393; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g85qZ1FvMG6faqprSy0FLzTopYNNuYvps+WJXcZIAvo=; b=ieL5YJgqQkGolEJX4fvLouVyP0h9OY3y45BpJh0rOljBktZtmTkBGDSVJspAQugn4T bqomV4/yxGd4jlusFMngKNgryj5yrOJ7NHpYTtQtfWgu90FuRH2v8nEJaa4SHfSHVeZu oYc0tIcDwp+VQRLkWN+dfvQwM3EfEfFhZ1OgXIEneAnNVw0wuPV6JQl4nipMenHWEzUD RUeCrCs92kEf5tLRz2SIoHAgJIi7yCIez0T71YXwEbQLKjYR8//HL6Qz71E+8KESB2P7 848ZR5+VAyktFhfE/2BI0McpHIV+VZvd64FzPSbhDYfroGd8r3Tu755yYuv8yCYy4ps9 itWg== X-Gm-Message-State: AC+VfDzDI0zHDI4BHYO+d4ACVOJHR5oSPevacMVPJJdccyA0+tOY+db7 NlpDP4wpxQqQxfEBZXnHvXA= X-Google-Smtp-Source: ACHHUZ7oSDZZxeNJ+6bsAjnzQlEkJ5xXFYBCyyz7j9Gs46RVwWN9KBZAy64iKxUd+WXp4Zsnvjqe6Q== X-Received: by 2002:a5d:4b0e:0:b0:304:a40c:43c6 with SMTP id v14-20020a5d4b0e000000b00304a40c43c6mr476541wrq.11.1682577392600; Wed, 26 Apr 2023 23:36:32 -0700 (PDT) Original-Received: from [2a01:4b00:89a0:2400::ffff:ffff] ([2a01:4b00:89a0:2400:28c0:e651:82a3:c49c]) by smtp.gmail.com with ESMTPSA id p17-20020a056000019100b002fda1b12a0bsm17662362wrx.2.2023.04.26.23.36.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Apr 2023 23:36:31 -0700 (PDT) In-Reply-To: X-Readdle-Message-ID: 4fd042a7-45ae-493e-8c73-680b7678920c@Spark X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260704 Archived-At: --644a17ee_793b2fcb_d3e2 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This worked=21 On 26 Apr 2023 at 4:40 PM +0100, Randy Taylor , wrote: > On Wednesday, April 26th, 2023 at 10:05, Randy Taylor w= rote: > > > On Wednesday, April 26th, 2023 at 09:44, Jimmy Wong wrote: > > > > > There hasn=E2=80=99t been any new releases since then, should emacs= rely on devel packages=3F > > > On 26 Apr 2023 at 2:37 PM +0100, Eli Zaretskii , wr= ote: > > > > > Date: Wed, 26 Apr 2023 14:26:09 +0100 > > > > > =46rom: Jimmy Wong > > > > > Cc: Yuan =46u , Eli Zaretskii , > > > > > 63086=40debbugs.gnu.org > > > > > > > > > > I=E2=80=99m using tree-sitter-go 0.19.1 from Macports. > > > > > > > > That version was released 2 years ago. Maybe go-ts-mode.el relies= on > > > > some newer functionality, or on some bug that was fixed since the= n=3F > > > > tree-sitter-go and a bunch of other grammars have dropped the ball of= versioning, I think (some don't even try to version properly...). Since = then there have plenty of changes, but it's stayed at the same version wi= th no new tags. Anything packaging based on the tags of those repositorie= s is going to be wildly out of date. > > > > You can try using =60M-x treesit-install-language-grammar=60 to insta= ll the go grammar, which will get the latest and greatest. > > > > If I had to guess what triggers the error, it's probably the (iota) m= atch which seems to have been added Jan 5, 2022. You can try removing tha= t from go-ts-mode and seeing if it fixes the issue for you (although mayb= e that will fix the current problem but reveal a bunch more...all of whic= h will be easily resolved by using a more up to date grammar). I'll try t= o get that old version installed myself and see. > > > > I think java-ts-mode and some others have a helper that checks which = queries are supported by testing them, I can make a patch for that if tha= t's the direction we want to go. > > I can reproduce this with the latest tagged tree-sitter-go version (v0.= 19.1 released on on Mar 3, 2021). I've attached a patch fixing it (i.e. g= o-ts-mode now runs and highlights), if we decide to support those older v= ersions. Hopefully I didn't commit any elisp sins. > > Please give it a try if you can, Jimmy. I still recommend that you upgr= ade to the latest tree-sitter-go (i.e. from the tip of the develop branch= ) yourself because v0.19.1 has other problems (some valid code can be hig= hlighted as error if using the highest treesit-font-lock-level). And I wo= uld recommend that for all of the tree-sitter grammars. > > > --644a17ee_793b2fcb_d3e2 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
This worked=21
On 26 Apr 2023 at 4:40 PM +0100, Ra= ndy Taylor <dev=40rjt.dev>, wrote:
On Wednesday, April 26th, 2023 at 10:05, Randy Taylor <dev=40= rjt.dev> wrote:

On Wednesd= ay, April 26th, 2023 at 09:44, Jimmy Wong <wyuenho=40gmail.com> wro= te:

There hasn=E2=80=99t been any new releases since th= en, should emacs rely on devel packages=3F
On 26 Apr 2023 at 2:37 PM +0100, El= i Zaretskii <eliz=40gnu.org>, wrote:
Date: Wed, 26 Apr 2023 14:26:09 +0100
= =46rom: Jimmy Wong <wyuenho=40gmail.com>
Cc: Yuan =46u <casouri=40gmail.com>, Eli Zaretskii <eliz=40gnu.o= rg>,
63086=40debbugs.gnu.org

I=E2=80=99m using tree-sitter-go 0.19.1 from Macports.
=
That version was released 2 years ago. Maybe go-ts-mode.el relies on
some newer functionality, or on some bug that was fixed since then=3F=

tree-sitter-go and a bunch of other grammars have dropped the ball = of versioning, I think (some don't even try to version properly...). Sinc= e then there have plenty of changes, but it's stayed at the same version = with no new tags. Anything packaging based on the tags of those repositor= ies is going to be wildly out of date.

You can try using =60M-x treesit-install-language-g= rammar=60 to install the go grammar, which will get the latest and greate= st.

If I had to guess what t= riggers the error, it's probably the (iota) match which seems to have bee= n added Jan 5, 2022. You can try removing that from go-ts-mode and seeing= if it fixes the issue for you (although maybe that will fix the current = problem but reveal a bunch more...all of which will be easily resolved by= using a more up to date grammar). I'll try to get that old version insta= lled myself and see.

I think java-ts-mode and= some others have a helper that checks which queries are supported by tes= ting them, I can make a patch for that if that's the direction we want to= go.

I can reproduce this wit= h the latest tagged tree-sitter-go version (v0.19.1 released on on Mar 3,= 2021). I've attached a patch fixing it (i.e. go-ts-mode now runs and hig= hlights), if we decide to support those older versions. Hopefully I didn'= t commit any elisp sins.

Please give it a try if = you can, Jimmy. I still recommend that you upgrade to the latest tree-sit= ter-go (i.e. from the tip of the develop branch) yourself because v0.19.1= has other problems (some valid code can be highlighted as error if using= the highest treesit-font-lock-level). And I would recommend that for all= of the tree-sitter grammars.



--644a17ee_793b2fcb_d3e2--