From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Wed, 13 Sep 2023 02:14:59 +0300 Message-ID: References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37624"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= To: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 13 01:16: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 1qgCcF-0009Xn-Fw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Sep 2023 01:16:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgCbu-0007pj-JJ; Tue, 12 Sep 2023 19:15:58 -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 1qgCbt-0007pX-UC for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 19:15:58 -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 1qgCbt-0004vq-Li for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 19:15:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgCby-0000lq-Ah for bug-gnu-emacs@gnu.org; Tue, 12 Sep 2023 19:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2023 23:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65470 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65470-submit@debbugs.gnu.org id=B65470.16945605162907 (code B ref 65470); Tue, 12 Sep 2023 23:16:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 12 Sep 2023 23:15:16 +0000 Original-Received: from localhost ([127.0.0.1]:60290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgCbE-0000kp-Fd for submit@debbugs.gnu.org; Tue, 12 Sep 2023 19:15:16 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:42601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgCbB-0000kb-Hm for 65470@debbugs.gnu.org; Tue, 12 Sep 2023 19:15:14 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 668EA5C00B7; Tue, 12 Sep 2023 19:15:03 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 12 Sep 2023 19:15:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694560503; x=1694646903; bh=7UNHWa7WMQUrSf4s1YSvPkDnuDNBiEmSTr+ oeAwU9Vk=; b=ALgUFPzMY7k7C9W3H5FBJ7+4qgyS1hvLCQS8mzDXowsIx47lAc6 BPouaKDOdBzNhp34qo9vm9A6CrC+Y+R+uLEP6crC9i6ga6wBXhf7+y25718wIcle AbSgrTlOsCVWtB64f4uCN12UmdUqeSDSMs6DHMQ5onbGa6ceScQjyJa0sIl7JCQ5 8kH81zJ6dDy9Q0rRuNUsKsQacyW7wfv57Igtn6S1ZchOjXdOLMqyyaWmmbCKE5qI 6d+AWATBiBOX18TAerbrKHXzuRb82p6VqW6npW0qrAsJJ/Q2hPUIDcw2pATWBn06 B9XvGkoS2rLhFXjuFJB2y2ZTSAwPGj9P8vg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694560503; x=1694646903; bh=7UNHWa7WMQUrSf4s1YSvPkDnuDNBiEmSTr+ oeAwU9Vk=; b=dQaB9Ymq7BuZqlQn20BuKzJsh7AZ9lzFMys1zxsFq4RAgX20axY oG7CQSsnLZaLhxJaUjv+mCFk7n9ULPG7IiU8+H6GUm/JKftoyUbC+/6kF/z/FQRU ITzthXfC9DegJIq/cZ1myD5fCNvP6SAvMc982sBMt5oiAiyZ9xdarONB4BWpColw zsabdiuJS0CGyN1VVR5eo6ebe3t1fs+rlOQIcXdplea0Wl8eZoODM5BFXKvh3F9i FtnwcuJHXCBANZVBa4xRSGKVTu15BBpgJ6TdxP91Lm1zjHCEcacWeL9zYLtcLUZk Df+tibzY2PaYvZkNcaBjOFmwFDhUgLdb1+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeijedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Sep 2023 19:15:01 -0400 (EDT) Content-Language: en-US In-Reply-To: <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> 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:270230 Archived-At: On 12/09/2023 09:29, Jostein Kjønigsen wrote: > Good feedback. I’ve tested and included those as well. Attached is a new patch. Thanks! Installed. It would've been better with a commit message too (next time). Speaking of the TSX difficulties, though, which Yuan hinted at recently: I think the current fix (tsx-ts-mode--font-lock-compatibility-bb1f97b) is not working. To be clear, that's unrelated to the current patch. Basically, the query for ((member_expression) @capture) succeeds, but then the more complex one fails with Structure error at: 22 (jsx_opening_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face) (jsx_closing_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face) (jsx_self_closing_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face) This patch seems to fix that and bring JSX syntax highlighting back: diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 57382c9cb31..7108ff49b28 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -163,7 +163,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b ;; but then raises an error if the wrong node type is used. So it is ;; important to check with the new node type (member_expression) (condition-case nil - (progn (treesit-query-capture language '((member_expression) @capture)) + (progn (treesit-query-capture language '(jsx_opening_element (member_expression) @capture)) '((jsx_opening_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face)