From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#66988: 30.0.50; treesit-forward-sexp not working properly in js-ts-mode and tsx-ts-mode Date: Fri, 10 Nov 2023 09:37:38 +0200 Organization: LINKOV.NET Message-ID: <86sf5enlyt.fsf@mail.linkov.net> References: <9cf7d7d0-33a3-4c07-bd66-bc4c59bdfefb@gmail.com> <39b0057b-ac0c-8271-0fe2-f4deef7ae8d3@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8764"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Theodor Thornhill , 66988@debbugs.gnu.org, =?UTF-8?Q?Lo=C3=AFc_?= =?UTF-8?Q?Lema=C3=AEtre?= , Yuan Fu To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 10 08:51:47 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 1r1MIr-00026X-LH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Nov 2023 08:51:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1MIb-0008Sv-9m; Fri, 10 Nov 2023 02:51:29 -0500 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 1r1MIX-0008SP-A9 for bug-gnu-emacs@gnu.org; Fri, 10 Nov 2023 02:51:26 -0500 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 1r1MIV-0002EX-H6 for bug-gnu-emacs@gnu.org; Fri, 10 Nov 2023 02:51:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1MJ8-0000Jt-No for bug-gnu-emacs@gnu.org; Fri, 10 Nov 2023 02:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Nov 2023 07:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66988 X-GNU-PR-Package: emacs Original-Received: via spool by 66988-submit@debbugs.gnu.org id=B66988.16996027141195 (code B ref 66988); Fri, 10 Nov 2023 07:52:02 +0000 Original-Received: (at 66988) by debbugs.gnu.org; 10 Nov 2023 07:51:54 +0000 Original-Received: from localhost ([127.0.0.1]:49453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1MJ0-0000JC-Eh for submit@debbugs.gnu.org; Fri, 10 Nov 2023 02:51:54 -0500 Original-Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]:37641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1MIw-0000Ij-3t for 66988@debbugs.gnu.org; Fri, 10 Nov 2023 02:51:52 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 62A6F240008; Fri, 10 Nov 2023 07:51:02 +0000 (UTC) In-Reply-To: <39b0057b-ac0c-8271-0fe2-f4deef7ae8d3@gutov.dev> (Dmitry Gutov's message of "Fri, 10 Nov 2023 03:41:00 +0200") X-GND-Sasl: juri@linkov.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:274093 Archived-At: > @@ -3843,6 +3843,7 @@ js--treesit-sexp-nodes > "undefined" > "arguments" > "pair" > + "parenthesized_expression" > "jsx") > "Nodes that designate sexps in JavaScript. > See `treesit-thing-settings' for more information.") I had the same problem and to make this mode more usable had to use such patch: diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 5a669fdbd42..4c07fbd94b7 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3825,7 +3825,9 @@ js--treesit-sentence-nodes See `treesit-thing-settings' for more information.") (defvar js--treesit-sexp-nodes - '("expression" + '("expression" ;; SHOULD NOT MATCH "expression_statement", BUT SHOULD MATCH "parenthesized_expression" + "parenthesized_expression" + "formal_parameters" "pattern" "array" "function" @@ -3843,7 +3845,13 @@ js--treesit-sexp-nodes "undefined" "arguments" "pair" - "jsx") + "jsx" + "statement_block" + "object" + "object_pattern" + "named_imports" + "class_body" + ) "Nodes that designate sexps in JavaScript. See `treesit-thing-settings' for more information.") PS: Also tried to replace (setq-local treesit-sexp-type-regexp (regexp-opt js--treesit-sexp-nodes)) with (setq-local treesit-sexp-type-regexp (rx-to-string `(seq bol (or ,@js--treesit-sexp-nodes) eol)))