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#75422: 30.0.93; [PATCH] forward-sexp and backward-sexp jump outside of comments in tsx-ts-mode Date: Tue, 07 Jan 2025 19:44:27 +0200 Organization: LINKOV.NET Message-ID: <87ldvmjz7o.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30527"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Yuan Fu , 75422@debbugs.gnu.org To: Kohei Tsuruta Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 07 18:48:30 2025 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 1tVDgr-0007im-QI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jan 2025 18:48:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVDgS-0008T3-5s; Tue, 07 Jan 2025 12:48:04 -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 1tVDgQ-0008Sq-FI for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 12:48:02 -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 1tVDgQ-0004RE-6Q for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 12:48:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=F8Em/bec+iTToYI6qn4QVnT4iWdrdD0oqSIDA4OSq8k=; b=M/gAZL61eVC/y38QQfKg98t3Ml1UwZKTqrr9M0sVRn/Xc2MUVg1t4i1ruRrBVSRDK8uEW20i5sOoaYfA5p8DPXWRhJ2jZy+CjGAujDUo69Txml2TbV3oPGDTZnRpAFxCaRk4zct8Wu5yF2x7A7wKFP9RiFwPw/jEMkxoPanTE2P8A+A4/dAJnxI9/du8OVSG/V3rjGnf09Rv3vpEwwnwqbRzz0jG0bUgHvCBvdmA1n3WLWQgG2JUYtoUiyxyDwrwK7qizuMQABAeKRBrP7KJSiiO6Qhyd4A7ZR7Kb5hq7h2o8bO2qcBGyd8P0nH1rC6gWbka63gDWEFFigjlBjzApA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVDgP-0003zU-NF for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 12:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2025 17:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75422 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75422-submit@debbugs.gnu.org id=B75422.173627202715269 (code B ref 75422); Tue, 07 Jan 2025 17:48:01 +0000 Original-Received: (at 75422) by debbugs.gnu.org; 7 Jan 2025 17:47:07 +0000 Original-Received: from localhost ([127.0.0.1]:44489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVDfX-0003yC-7C for submit@debbugs.gnu.org; Tue, 07 Jan 2025 12:47:07 -0500 Original-Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:47011) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVDfV-0003xb-9O for 75422@debbugs.gnu.org; Tue, 07 Jan 2025 12:47:06 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C7D4760003; Tue, 7 Jan 2025 17:46:56 +0000 (UTC) In-Reply-To: (Kohei Tsuruta's message of "Tue, 07 Jan 2025 08:02:02 -0800") 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:298733 Archived-At: > Steps to reproduce > - emacs -Q test.tsx > - (tsx-ts-mode) > - Move point at the end of the comment at line 3 > - (backward-sexp) > > The expected point position after (backward-sexp) is "treesit-thing-|settings" > or at least stay inside of the comment line, however, point moves to the > beginning of "Hello". > Likewise, if you C-x C-e at the end of the comment line, it evaluates "Hello". > > --- test.tsx (| is point) --- > export const App = () => { > const greeting = "Hello" > // treesit-thing-settings| > return <>{greeting} > } > --- END test.tsx --- > > It happens because tsx-ts-mode doesn't recognize comments. In > typescript-ts-base-mode, treesit-thing-settings is set to have "text" as > a thing for typescript but it's missing in tsx-ts-mode when it's set for > tsx. Thanks for the report. This is fixed in Emacs 31. However, maybe Yuan will agree to add this small fix to Emacs 30? > diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el > index 4a38d1da596..0ffcb144771 100644 > --- a/lisp/progmodes/typescript-ts-mode.el > +++ b/lisp/progmodes/typescript-ts-mode.el > @@ -564,7 +564,9 @@ tsx-ts-mode > (sentence ,(regexp-opt > (append typescript-ts-mode--sentence-nodes > '("jsx_element" > - "jsx_self_closing_element"))))))) > + "jsx_self_closing_element")))) > + (text ,(regexp-opt '("comment" > + "template_string"))))))