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#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Sat, 16 Sep 2023 14:40:02 +0300 Message-ID: <831qeyibxp.fsf@gnu.org> 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> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> <834jjuicun.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28283"; mail-complaints-to="usenet@ciao.gmane.io" Cc: btuin@mailo.com, jostein@secure.kjonigsen.net, 65470@debbugs.gnu.org, theo@thornhill.no, monnier@iro.umontreal.ca To: dmitry@gutov.dev, casouri@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 16 13:41:33 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 1qhTg2-00074p-WF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Sep 2023 13:41:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhTfq-0006W9-JU; Sat, 16 Sep 2023 07:41:18 -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 1qhTfT-0006TG-Uo for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 07:40:57 -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 1qhTfT-0003dH-Mg for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 07:40:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhTfa-00032n-97 for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 07:41:02 -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, 16 Sep 2023 11:41: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.169486444111663 (code B ref 65470); Sat, 16 Sep 2023 11:41:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 11:40:41 +0000 Original-Received: from localhost ([127.0.0.1]:45582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhTfE-000323-F4 for submit@debbugs.gnu.org; Sat, 16 Sep 2023 07:40:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhTfA-00031o-KO for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 07:40:38 -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 1qhTev-0003T5-VM; Sat, 16 Sep 2023 07:40:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=RgBiPQTqN+xbFVq5ntn6NWHhfP86/TPn6E30EWtPhoM=; b=gRW6Enu6cY9Ul1r4CW3T mNqJ7QxgPnQiP6ZlWE9u1oHhhL3xkxlQr+ZbXUxu1wodzSWhrG84XldSkXzJ0ELwhyAa7d6a/Uibr CsB1+3l/Ap4xXwkYLrwsQHvVuqx3IUO1QDAVz8OY61OZbUtaGQYqkuazlyIfWWlH4HRyq5nZAkqdO A465P+hHOUjL8Omr4E7ohEIoWrsmhQfYywPP1HgvqGKeMsf4h1UDqHym2oJ/qrZHpMZD4Suxtl0Qk KTBpu/sbXL9/gthZnIc77lnR9wAZRk4CBZsMj4IuEi+WcuvS1+j1fU/u32Og2YbVH8NnT6pdmE4yR 22oTF2qicbMmxA==; In-Reply-To: <834jjuicun.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Sep 2023 14:20:16 +0300) 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:270613 Archived-At: > Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, > jostein@secure.kjonigsen.net, monnier@iro.umontreal.ca, btuin@mailo.com > Date: Sat, 16 Sep 2023 14:20:16 +0300 > From: Eli Zaretskii > > > Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, > > jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net > > Date: Sat, 16 Sep 2023 08:54:32 +0300 > > From: Eli Zaretskii > > > > > Date: Fri, 15 Sep 2023 16:35:55 +0300 > > > Cc: Eli Zaretskii , Yuan Fu , > > > Theodor Thornhill , > > > Jostein Kjønigsen , btuin@mailo.com, > > > 65470@debbugs.gnu.org > > > From: Dmitry Gutov > > > > > > On 15/09/2023 15:11, Jostein Kjønigsen wrote: > > > >> 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) > > > >> > > > > I really don’t know this part of the code very well. If you’ve identified an issue/bug for a specific TSX use-case, and found a fix for it, I have no objections to it being applied. > > > > > > No problem, pushed that to emacs-29, thanks. > > > > This seems to cause: > > > > INFO Scraping files for loaddefs...85% > > typescript-ts-mode:0: Warning: Not registering prefix "ts". Affects: ("tsx-ts-mode--indent-compatibility-b893426" "tsx-ts-mode--font-lock-compatibility-bb1f97b" "tsx-ts--s-p-query" "tsx-ts--syntax-propertize" "ts-ts--s-p-query" "ts-ts--syntax-propertize" "ts-ts--syntax-propertize-captures") > > > > Stefan, what do we usually do with such warnings? > > This also causes byte-compilation warnings on a system that has no > tree-sitter installed: > > In end of data: > progmodes/typescript-ts-mode.el:498:17: Warning: the function ‘treesit-node-end’ is not known to be defined. > progmodes/typescript-ts-mode.el:497:17: Warning: the function ‘treesit-node-start’ is not known to be defined. > progmodes/typescript-ts-mode.el:474:6: Warning: the function ‘treesit-query-compile’ is not known to be defined. > > Could you please fix these? I fixed this myself by simply declaring the functions the byte-compiler was complaining about, but I'd be happier if someone could explain these warnings, since the offending functions are not called anywhere in the code I could see. What did I miss?