From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kohei Tsuruta 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 08:02:02 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23623"; mail-complaints-to="usenet@ciao.gmane.io" To: 75422@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 07 17:03:20 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 1tVC36-0005sZ-A5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jan 2025 17:03:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVC2t-0000RO-PF; Tue, 07 Jan 2025 11:03:08 -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 1tVC2p-0000Qw-0z for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:03:03 -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 1tVC2o-0008V3-Oi for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:03: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:From:To:Subject; bh=IAnSBmQU7DOZp3R+Tb0L41ntWEP26Ym3fKaGSxyqnvU=; b=mhh+5gG0YqIM56XCKNY64aV8MqtE4R2Kr7omtWPNFhFPhOKP6Az/kJ2+xl2U2Hnn1q6GHbaL2AEdSegDmDQjnMffuHg+Wtj+UpWv6eGu1VJhliI5ygA28uCJIpKEHGs/CxPbSfrDcasMLlwEqR4yCN0POY5HyJ5GK8VI1E7gLF1iHCEZ9kw+zyZkDUDpqsWGGn2SbqUTy+DxHbNVp2r5XQb5MJd4ulBxFPVI1A6ppuFbWJPVgdVmRXb4bU/8Ct3ylahHP6/42xpozB4eUJwu7UPcsWKhkQRMR0nM8TjMvvwXGm6uphpuJABLbU0N2Q4kpDvWplnhgFrk3VpkJzNrmA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVC2o-0006yN-3o for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kohei Tsuruta Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2025 16:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75422 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173626574726751 (code B ref -1); Tue, 07 Jan 2025 16:03:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jan 2025 16:02:27 +0000 Original-Received: from localhost ([127.0.0.1]:44289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVC2E-0006xO-Ur for submit@debbugs.gnu.org; Tue, 07 Jan 2025 11:02:27 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:46628) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVC2C-0006x1-EJ for submit@debbugs.gnu.org; Tue, 07 Jan 2025 11:02:25 -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 1tVC20-0000Nw-UX for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:02:14 -0500 Original-Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVC1y-0008OT-Q8 for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2025 11:02:12 -0500 Original-Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-21a1e6fd923so14729775ad.1 for ; Tue, 07 Jan 2025 08:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736265725; x=1736870525; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=IAnSBmQU7DOZp3R+Tb0L41ntWEP26Ym3fKaGSxyqnvU=; b=Qt/40hjXbILGSejpQGNAnFZrah2SP8krkP0t7DoMvZXkMT93RqyTgjy+AiJY6SAYTL chxn9MCpTR0mQi2RzzcP+8fZz9ErwQcILCfNXKv4koAw5oZeoIB9VUGn7yDxtCT9dITY v2Gc2TlBfjc8rt/14tVpeTT/z2yplEsRkGbkSFfBdhprGXF0mZkQ79BX6VnXzLLIovEb 4Nqad7LDq/NC6kf8/WDEm8kdgsTE5wnotvDb6F85PXcfmyh4QzzslMg6FNrF7/LtL6sX 3agzoW5obO4UuRJoaMvfGjaY3zP2MucuT2AZOuNGhK2qP7hBsD8nB/lnAon+SDT/yVgr nRnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736265725; x=1736870525; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IAnSBmQU7DOZp3R+Tb0L41ntWEP26Ym3fKaGSxyqnvU=; b=WsiZgOfbu8Y7pkzbrp1y1VMTh6Ojg8lyl0KkwOoKbdI8ezJQf71eCW293bTUjR0b/x WZkxdzcetUP7GcVX51cRgR+IhuJcGnVxGMoLPCCBT8Pp2kHX8DgzhIGLtB4wdagqCi9I vpqo4PyOQzuAVHqHV/IlQmcHW6q1bVPfr7c5oi4LUcK2IpKP+FehuAKUqedf53aElpIY +FO0kOo8o3y8mkHmdnxanYljOI4LBnRCYHIUw9PbByHXmov5HIzi8cUiVgvRlnsjFmW+ 3bXgMLhY3IvE7Tlg9dr/udz0+areQc5ZFlxxOE+2koRmOpBO24O/tvwZuId08WWEEG4t 45QA== X-Gm-Message-State: AOJu0YzcnbaIObXe3fPKDO6PvHtMJP1jGvapgzwhDwDbYSNsH+HHG3ZX p/cd5cpe9xDI2EHlerGzvSi9WC3SKVGiYvONnIDB/Tt6UtIqxkKv6ONqtQ== X-Gm-Gg: ASbGncsDzvrsEPOfogodClIwhVVNT3E1MptfH39wLufh+wkFkVU3/pwNgbxapV5YTg8 AyJFe1fB+jv9Rc7tmkz6Cd1ahGKF/CPT8+ZCSd7GARn5j1Bmb+P6GbX+jzHVByTlPPw6fmfP5mk syfK73MhFl5xQE/mf5yyj4qMYcY5jFc8vEo7lXIeKdLxmNeGBcqh/rWU3UdA7CFcViKWji2716s oAGIf8AS/pvd1ckh7/I2gmpGqX18EAFzsGZxSdc7lmw7PbHm8DnS7rrdNi8ows= X-Google-Smtp-Source: AGHT+IHxQqYhbXB3g+7E7hwUeDnTkadWF2hxRvYlkK7Y1HNGk93VAnhkuzRyDpYCP9A/sLKW6U8Yrg== X-Received: by 2002:a17:902:f548:b0:216:48dd:d15c with SMTP id d9443c01a7336-219e6ebd135mr681488615ad.27.1736265725221; Tue, 07 Jan 2025 08:02:05 -0800 (PST) Original-Received: from localhost ([2a02:6ea0:e60c:5003:5f7:d06a:894:4b56]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc96294bsm311997735ad.36.2025.01.07.08.02.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 08:02:04 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=seventhepg@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:298729 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-text-as-a-thing-in-tsx-ts-mode.patch >From d1c5aa45213e4011dfb641edb0d064e5d02e370d Mon Sep 17 00:00:00 2001 From: Kohei Tsuruta Date: Tue, 7 Jan 2025 07:36:14 -0800 Subject: [PATCH] Add "text" as a thing in tsx-ts-mode * lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode): Add definition of "text" --- lisp/progmodes/typescript-ts-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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")))))) ;; Font-lock. (setq-local treesit-font-lock-settings -- 2.39.5 (Apple Git-154) --=-=-= Content-Type: text/plain In GNU Emacs 30.0.93 (build 3, aarch64-apple-darwin24.1.0, NS appkit-2575.20 Version 15.1.1 (Build 24B91)) of 2025-01-05 built on mac.lan Repository revision: 505c1123e18a8a710fc60e05a4c870497bf580f4 Repository branch: emacs-30 System Description: macOS 15.1.1 Configured using: 'configure --with-native-compilation --disable-ns-self-contained --with-tree-sitter' Configured features: ACL GNUTLS LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: bug-reference-prog-mode: t paredit-mode: t rainbow-delimiters-mode: t whitespace-mode: t which-function-mode: t corfu-terminal-mode: t corfu-history-mode: t global-corfu-mode: t corfu-mode: t marginalia-mode: t vertico-mode: t savehist-mode: t recentf-mode: t winner-mode: t repeat-mode: t save-place-mode: t delete-selection-mode: t electric-pair-mode: t minibuffer-depth-indicate-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort emacsbug mail-extr ispell log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util vc consult-imenu help-fns radix-tree cl-print debug backtrace find-func dabbrev vertico-directory c++-ts-mode c-ts-mode js c-ts-common treesit cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs time-date misearch multi-isearch vc-git diff-mode track-changes vc-dispatcher bug-reference descr-text grep embark-consult embark ffap texinfo texinfo-loaddefs files-x consult bookmark pp add-log term/xterm xterm paredit cape rainbow-delimiters disp-table whitespace merge-n-save flymake project compile text-property-search comint ansi-osc ansi-color thingatpt which-func imenu corfu-terminal popon corfu-history corfu orderless marginalia vertico compat savehist recentf tree-widget wid-edit winner ring repeat saveplace delsel elec-pair finder-inf solarized-light-theme solarized-theme solarized solarized-faces color edmacro kmacro mb-depth delight comp comp-cstr warnings comp-run comp-common rx cl-extra help-mode use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core avy-autoloads cape-autoloads corfu-terminal-autoloads corfu-autoloads delight-autoloads dumb-jump-autoloads dash-autoloads embark-consult-autoloads consult-autoloads embark-autoloads exec-path-from-shell-autoloads expand-region-autoloads marginalia-autoloads markdown-mode-autoloads info orderless-autoloads paredit-autoloads popon-autoloads popup-autoloads rainbow-delimiters-autoloads s-autoloads solarized-theme-autoloads vertico-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 334937 64735) (symbols 48 32870 14) (strings 32 126791 4029) (string-bytes 1 4022076) (vectors 16 34459) (vector-slots 8 436900 32986) (floats 8 362 7583) (intervals 56 3954 480) (buffers 992 27)) --=-=-=--