From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincenzo Pupillo Newsgroups: gmane.emacs.bugs Subject: bug#64647: treesit-query-error due to a recent change to tree-sitter-javascript grammar definition Date: Sat, 15 Jul 2023 21:39:49 +0200 Message-ID: <2891516.e9J7NaK4W3@fedora> References: <2171209.irdbgypaU6@fedora> <874jm5rrgk.fsf@thornhill.no> <83edl9asth.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35737"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64647@debbugs.gnu.org, jostein@kjonigsen.net To: Theodor Thornhill , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 15 21:40: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 1qKl7r-00098P-Uc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jul 2023 21:40:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKl7b-0000Sn-Vg; Sat, 15 Jul 2023 15:40:03 -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 1qKl7a-0000SK-Po for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 15:40:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKl7a-0004B5-HH for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 15:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKl7a-0001jK-DJ for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 15:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincenzo Pupillo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jul 2023 19:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64647 X-GNU-PR-Package: emacs Original-Received: via spool by 64647-submit@debbugs.gnu.org id=B64647.16894500006631 (code B ref 64647); Sat, 15 Jul 2023 19:40:02 +0000 Original-Received: (at 64647) by debbugs.gnu.org; 15 Jul 2023 19:40:00 +0000 Original-Received: from localhost ([127.0.0.1]:46133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKl7X-0001it-Lz for submit@debbugs.gnu.org; Sat, 15 Jul 2023 15:40:00 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:53681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKl7U-0001iS-Iy for 64647@debbugs.gnu.org; Sat, 15 Jul 2023 15:39:57 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3110ab7110aso3305907f8f.3 for <64647@debbugs.gnu.org>; Sat, 15 Jul 2023 12:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689449991; x=1692041991; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Sw/xqHgNyQ27QFDFCxMEwraueOkKhBU1eUA3KY2Oqcw=; b=ZOfWzAzRQD+3Qa4tkCPM4P5O4nsy3DPAXGG0H79r3I6uSJJXmX2ex2ekujUO5XD/Zc FdjrP+s7lnLXkVnU8VlnmoEGXCT6TvFWL4dXQPgols2rc8y4UlhNBbj/JBmW4CfoPieR dVFiK3gD/s7oKS5tLzD7bCjoOZaBRgNcprU64royD8iW1YDmLS1WzDUUFMNbPkQzSL2Y 3rrW5szpywSGxQinF4Ae9UXv2C5CZPDcmG5JxSKJTK9b487X1DCDPIP+KVbSep2ODWPG sL1VLUO3nM0/Thj77QCtFIjH0AhIybSNVREeaMcIN8yZkZa4d88LBQVvvi1yJSXiTOKk /kmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689449991; x=1692041991; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sw/xqHgNyQ27QFDFCxMEwraueOkKhBU1eUA3KY2Oqcw=; b=kGZliX0UJ61uGxudhByxs/zOuGyiOZnUYQCaIN6nqeuENsiR+M7DS/LKE7gDHs+VfB bwd0VXiCtlV2pQO3ocyeCIgFS6tNcDgLSJgab03OMKBYTN9m000iBT25Zrq67oefyCGq 02+cdFLoojpoy9PdLqvtbJS9oNKrD17y4jz1t0QDk69R3zifVHCkjPiNQy/g5Pwj/Vtd OxH4GueOfkKKNUXyMeyqVWLR4gAmJL6Fcd1NMzIIS4SOSdV4crqXmuLY4raLyrakiQSF 7ITybYB8OSj8uGhjO4xOCM1tGz5e2hQkzFGOkXXhBrHE3ro1SZ4pv5dm4sFHHXfuXJZc GDtQ== X-Gm-Message-State: ABy/qLbEmhn+2OW3Nd0JA2U9xdPdac/indrI9WliF/cIEFWAj8Hk4B1w KF4BoFpXYT4XMRWKcDdtgrE= X-Google-Smtp-Source: APBJJlFXSdKia9kMq4Ln1IF2B9+G83RnYeuan1N4PvFgyjACnjYmVrG/T6zq04EIpxKNajwPleX0hA== X-Received: by 2002:a5d:60c6:0:b0:315:9de4:92f0 with SMTP id x6-20020a5d60c6000000b003159de492f0mr7066901wrt.5.1689449990489; Sat, 15 Jul 2023 12:39:50 -0700 (PDT) Original-Received: from fedora.localnet (2-230-139-124.ip202.fastwebnet.it. [2.230.139.124]) by smtp.gmail.com with ESMTPSA id k2-20020a5d5182000000b003143aa0ca8asm14576200wrv.13.2023.07.15.12.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 12:39:49 -0700 (PDT) In-Reply-To: <83edl9asth.fsf@gnu.org> 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:265243 Archived-At: In data sabato 15 luglio 2023 21:16:42 CEST, Eli Zaretskii ha scritto: > > From: Theodor Thornhill > > Cc: Vincenzo Pupillo , Jostein Kjonigsen > > > > , 64647@debbugs.gnu.org > > > > Date: Sat, 15 Jul 2023 19:54:03 +0200 > > > > Eli Zaretskii writes: > > >> The patch in attachment fixes both problems. > > > > > > Will the patch work with the grammar libraries before the recent > > > change? > > > > It will introduce regressions, but the patch itself is a change for the > > better, both in emacs land and in the grammar itself. > > What kinds of regressions? > > > I don't disagree, but I think this is a difficult problem to solve, but > > with an easy cop-out solution that most other implementors use - just > > refer to the last supported commit. We've had some discussions on this, > > but IIRC we never settled on anything. Personally, I think a > > > > ;;; Tree-sitter-version: bb1f97b643b77fc1f082d621bf533b4b14cf0c30 > > > > header may be the simplest way to at least signal some awareness > > here. That way the auto install mechanism can pull that hash directly > > and we can ensure some sort of compatibility checking. > > > > What do you think? > > I think what I wrote: that we should try to make our modes work with > reasonably old versions of the grammars, if that is practical. While > in general it could be a very difficult, if not impossible, to achieve > that, the question is whether this particular issue can be solved in > that manner. If it can, we should do it. I can rewrite both patches in the same way I had patched java-ts-mode. Basically, there are only two changes. I think it would be useful to have a function to check whether grammar features are supported or not. For example, a specialized version of treesit-query-validate that could also be used in interactive mode (to simplify the development). Do I rewrite the patches?