From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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 15:57:46 +0300 Message-ID: <83y1jhbad1.fsf@gnu.org> References: <2171209.irdbgypaU6@fedora> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17010"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64647@debbugs.gnu.org To: Vincenzo Pupillo , Theodor Thornhill , Jostein Kjonigsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 15 15:13:31 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 1qKf5W-0004Dv-FJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jul 2023 15:13:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKeqZ-0002Y7-IW; Sat, 15 Jul 2023 08:58: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 1qKeqY-0002Xj-AG for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 08:58: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 1qKeqY-0003zv-2l for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 08:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qKeqX-0004j5-Vn for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2023 08:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jul 2023 12:58:01 +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.168942585718124 (code B ref 64647); Sat, 15 Jul 2023 12:58:01 +0000 Original-Received: (at 64647) by debbugs.gnu.org; 15 Jul 2023 12:57:37 +0000 Original-Received: from localhost ([127.0.0.1]:44345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKeq8-0004iG-Kn for submit@debbugs.gnu.org; Sat, 15 Jul 2023 08:57:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKeq6-0004i3-M1 for 64647@debbugs.gnu.org; Sat, 15 Jul 2023 08:57:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKepy-0003fy-V0; Sat, 15 Jul 2023 08:57:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=W0xFE9zqrg4cMsNdEEU/VJdO0TNHh5TbTNFAu2GcB8M=; b=r1W/CrGn/GD0 qfzBV/rWpAsaUE65gbwul8bFyPLwn2qlvKq4ncvGlro2KDuCByKpiN6Au2QBFQevekhigTEgyb+g6 gX6TZEX396pMTdAWJIeSVBm6X4ei3QDmSMaGRUD01ZiwuQJqWhCZSQ0DRKNKDxy6IEn3e9B2HNMIn DASBgN035Roc8KbkUww1rtM0d+C3dWF346Abfo6Xi+qLMJWhANSZFHThD1maxiJJ/Et9cfwFCyz/p TL3UuNeeOsLOqqnfV26Oeg/HKN8ZnGme9svfgRGCbE7VV1A+yMZ0vtDMFJeuvcU1c41LPMblsIC7O 8i3Ln148xBGkbqN4OlqF9Q==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKepw-0005cd-Mn; Sat, 15 Jul 2023 08:57:26 -0400 In-Reply-To: <2171209.irdbgypaU6@fedora> (message from Vincenzo Pupillo on Sat, 15 Jul 2023 14:34:29 +0200) 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:265200 Archived-At: > From: Vincenzo Pupillo > Date: Sat, 15 Jul 2023 14:34:29 +0200 > > this commit (bb1f97b643b77fc1f082d621bf533b4b14cf0c30) changed the definition > of the JSX grammar to tree-sitter-javascript. This causes a node type error: > " > Error while displaying: (jit-lock-function 1) reported (treesit-query-error > "Node type error at" 24 "(jsx_opening_element [(nested_identifier (identifier)) > (identifier)] @font-lock-function-call-face) (jsx_closing_element > [(nested_identifier (identifier)) (identifier)] @font- lock-function-call-face) > (jsx_self_closing_element [(nested_identifier (identifier)) (identifier)] @font- > lock-function-call-face) (jsx_attribute (property_identifier) @font-lock- > constant-face)" "Debug the query with `treesit-query-validate'") > " > Indentation also has problems due to the deletion of "jsx_fragment" definition. > > The patch in attachment fixes both problems. Will the patch work with the grammar libraries before the recent change? > p.s. nvim-treesitter tries to limit these problems by indicating which commit > to install. Does it make sense to try a similar approach with emacs as well? I think it is better if we make the code work with as many versions as possible, by checking whether a feature exists before using it. Theo, Jostein: any comments or ideas? Thanks.