From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#73978: 31.0.50; Text syntax applied on too many things in tsx-ts-mode Date: Wed, 23 Oct 2024 21:06:40 -0700 Message-ID: <1A3DAA8F-F00A-4984-AC0F-E62F021A690B@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30039"; mail-complaints-to="usenet@ciao.gmane.io" Cc: theo@thornhill.no To: 73978@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 24 06:07:54 2024 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 1t3p8b-0007ff-Ry for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Oct 2024 06:07:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3p8J-0004jZ-PZ; Thu, 24 Oct 2024 00:07:35 -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 1t3p8I-0004j9-5s for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2024 00:07:34 -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 1t3p8H-0003zW-T2 for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2024 00:07:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:Mime-Version:From:To:Subject; bh=W5yEMn9663AgctmS5BZN8EiDt5s2xGp/db50scMQl7s=; b=DoBm05Gh1N6k821qiqeig4XUrhQIPFMZqlRPIr85IWw5PtBCSZmBQuRZqntDT+ISTDSb27vGKfUecOpzWgeMWrZESmp5RN/fc90ksFUVHMpRfpazsle4UEk9BIOsfHBSaxf7OqYlz2bMLH/JAYGJMDj4C0/Ltov5NCju9Fqg/rim/VXc435aPjKQQlXM16CIEha8ZvdXBUkt+K+uo5Yp0MHSpcIrdeJQdoDdEpuufMMolOKGetjGstgzPqIkwd0I563WGYKcvrBiSrmp97UwYQiZ+FLDs/4dtGpN8dhsYh+hgNUZBLdm1cGFVvjqAtGByQMxjJ50ELFl2JLLjXCANg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t3p8k-0002UX-9I; Thu, 24 Oct 2024 00:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: theo@thornhill.no, bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Oct 2024 04:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73978 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Bug Report Emacs X-Debbugs-Original-Xcc: theo@thornhill.no Original-Received: via spool by submit@debbugs.gnu.org id=B.17297428569536 (code B ref -1); Thu, 24 Oct 2024 04:08:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Oct 2024 04:07:36 +0000 Original-Received: from localhost ([127.0.0.1]:33173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3p8J-0002Tj-Rr for submit@debbugs.gnu.org; Thu, 24 Oct 2024 00:07:36 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3p8G-0002TV-Vo for submit@debbugs.gnu.org; Thu, 24 Oct 2024 00:07:34 -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 1t3p7h-0004hA-AE for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2024 00:06:58 -0400 Original-Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3p7e-0003yB-Ru for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2024 00:06:55 -0400 Original-Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-71e6cec7227so404327b3a.0 for ; Wed, 23 Oct 2024 21:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729742812; x=1730347612; darn=gnu.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=W5yEMn9663AgctmS5BZN8EiDt5s2xGp/db50scMQl7s=; b=hL+agcrc8iJd5uYetluexXEnj5m6TEHkudcMtfTepfIORH3dWus2eF5uTDDlxFf7r/ 82n9rqQ5KziEuFrLwUmHEyZLukWsQnIEJ9V8K5T75E6MSJo8jOjHlj5Ef8Zv25ea4I87 EOfIwbtuRXRf84qYCC7MIT0Hk10MgrljN+PG2GhAjV5bLhOJmCkIdeu/4Pnps7h2z9/g z0WldtTUvVVhmsppl/5Qvd5p7Ohl0nHeJCv+33Qg7Ckj8v37A9RYBwj+uvRLmD1rV26E Yfh9jNdgcIn5ktckCFf9A6uNhhQnGWHVjOjuLUGQHKnFPymnh5u2iVKa8WHZ/SXIU7Hf nPMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729742812; x=1730347612; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=W5yEMn9663AgctmS5BZN8EiDt5s2xGp/db50scMQl7s=; b=XH5fSnTCGY00w8+W0ypHeX7r+PjtZU0rm1OjhMD+2QhoR4yJfQMMHThbr+M5UWxV6F cR+AVA0FCL+jcv98r+NrxbVPxePeOx0YsAoh+DLK+GTnQs/ykF8krrZ6ud1gc6Py14A5 FvHkyI4LTziFPNxfWc+Ke5/ylL3yfO39wrUjwIoy1GGDZ+ndBIiR4n4G1g1oD3WzGcaz 0py0bGM8PN6aGkthcYiJU6l+QeILIF6jkva/60safXkHr1MqKmaAcboAn8xi5YDudAPw lRVA2ECrRApQ0pMwZmTrS+JAIn4F+/6fe3CSU62eE/de6wBrvUdVq82f2SDozkB8bN7Q 19Xg== X-Gm-Message-State: AOJu0YzZrRtiUxj6m8DWcMZYRPyiCZVJ5VGs3TOUs1ed+4xdY/Aao+RM YOHBaP+Ny2yiPiJ1F7D6m5SsOb88w7tOrof3jxDTdB+9NhxFkV4OfAJb9A== X-Google-Smtp-Source: AGHT+IHUhZVtyIgyZx+QKqa3XaEn2jLMoXF2XgAv+rBvvqlwyL5vEdH6fvbWz5+XHLIdoesfnrXfjA== X-Received: by 2002:a05:6a20:2d2c:b0:1d7:8a9:63c with SMTP id adf61e73a8af0-1d989d2f466mr563360637.49.1729742812152; Wed, 23 Oct 2024 21:06:52 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:84ce:e0ef:6d50:ee70]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e77e4e1841sm339917a91.23.2024.10.23.21.06.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2024 21:06:51 -0700 (PDT) X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=casouri@gmail.com; helo=mail-pf1-x42d.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:294165 Archived-At: X-Debbugs-CC: theo@thornhill.no In tsx-ts-mode we use this query to apply syntax properties: (defvar tsx-ts--s-p-query (when (treesit-available-p) (treesit-query-compile 'tsx '(((regex pattern: (regex_pattern) @regexp)) ((variable_declarator value: (jsx_element) = @jsx)) ((assignment_expression right: = (jsx_element) @jsx)) ((arguments (jsx_element) @jsx)) ((parenthesized_expression (jsx_element) = @jsx)) ((return_statement (jsx_element) @jsx)))))) And then in tsx-ts--syntax-propertize-captures we mark everything enclosed by the captured jsx_element nodes in text fences. Then for the following code All the func() and other code will be considered text because the whole jsx tag () are wrapped in string fences. Theo, what=E2=80=99s the original intention for marking jsx_elements as text? = Can we only mark jsx_text as string? Yuan