From unknown Wed Jun 18 23:14:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65134 <65134@debbugs.gnu.org> To: bug#65134 <65134@debbugs.gnu.org> Subject: Status: [PATCH] * lisp/progmodes/js.el Fix js-ts-mode indent bug in JSX expressions Reply-To: bug#65134 <65134@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:14:11 +0000 retitle 65134 [PATCH] * lisp/progmodes/js.el Fix js-ts-mode indent bug in J= SX expressions reassign 65134 emacs submitter 65134 Danny Freeman severity 65134 normal tag 65134 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 07 16:10:35 2023 Received: (at submit) by debbugs.gnu.org; 7 Aug 2023 20:10:36 +0000 Received: from localhost ([127.0.0.1]:34435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT6Yl-0000JT-HV for submit@debbugs.gnu.org; Mon, 07 Aug 2023 16:10:35 -0400 Received: from lists.gnu.org ([2001:470:142::17]:45846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT6Yh-0000JC-02 for submit@debbugs.gnu.org; Mon, 07 Aug 2023 16:10:34 -0400 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 1qT6Ya-0002cR-VV for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2023 16:10:24 -0400 Received: from out-107.mta1.migadu.com ([2001:41d0:203:375::6b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qT6YY-0004sT-Ox for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2023 16:10:24 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1691439017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=TthWi/UhWihvYRh10Ul72RXmsiLv1RzJIl+URtczXkM=; b=ZMmzDNb7ql33M0bYVeCOsny1SRAcxEr9gY5iMUeREbR7ixpJvMVnCVBdlaV6siEykHuCPh huBZhcf5T+Tj40Hmz2dIISSO+VeXTPrUGPS8qlaHDHbsvC3vSYKYYkjLXOUCbujeZhbm+1 O9sGHkULSvm825Kd9ZKJuc8QGC4yy/Y= From: Danny Freeman To: bug-gnu-emacs@gnu.org Subject: [PATCH] * lisp/progmodes/js.el Fix js-ts-mode indent bug in JSX expressions Date: Mon, 07 Aug 2023 16:10:13 -0400 Message-ID: <87tttak40q.fsf@dfreeman.email> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::6b; envelope-from=danny@dfreeman.email; helo=out-107.mta1.migadu.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: v.pupillo@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch Hello, I have a patch for a bug I found in js-ts-mode. When editing jsx blocks, the indentation does not work. For example, in a file with the following file with JSX code in it and js-ts-mode enabled ``` function App() { return (
); } ``` placing your cursor at the end of the opening div tag and pressing ENTER does not indent, instead there is no indentation. This patch corrects that by properly expanding the `js-jsx--treesit-indent-compatibility-bb1f97b' function, which returns some indent rules. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-lisp-progmodes-js.el-Fix-js-ts-mode-indent-bug-in-JS.patch >From c13be16dd796c981455e99af5597d7861ed10631 Mon Sep 17 00:00:00 2001 From: dannyfreeman Date: Mon, 7 Aug 2023 15:55:27 -0400 Subject: [PATCH] * lisp/progmodes/js.el Fix js-ts-mode indent bug in JSX expressions Properly expand the indentation rules. Before this change, treesit indent mechanisms were trying to call this compatability function like a matching or anchor rule. This resulted in an error when running `indent-for-tab-command` while the cursor was in a JSX expression. "treesit--simple-indent-eval: Wrong number of arguments: ((cl-struct-js--pitem-tags ido-cur-list t) nil "Indent rules helper, to handle different releases of tree-sitter-javascript." --- lisp/progmodes/js.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index f2d7d3d3ecb..c7a031697f1 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3474,7 +3474,7 @@ js--treesit-indent-rules ((parent-is "statement_block") parent-bol js-indent-level) ;; JSX - (js-jsx--treesit-indent-compatibility-bb1f97b) + ,@(js-jsx--treesit-indent-compatibility-bb1f97b) ((node-is "jsx_closing_element") parent 0) ((match "jsx_element" "statement") parent js-indent-level) ((parent-is "jsx_element") parent js-indent-level) -- 2.40.1 --=-=-= Content-Type: text/plain Thank you, -- Danny Freeman --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 08 05:22:44 2023 Received: (at submit) by debbugs.gnu.org; 8 Aug 2023 09:22:44 +0000 Received: from localhost ([127.0.0.1]:35184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTIvL-0004r3-NJ for submit@debbugs.gnu.org; Tue, 08 Aug 2023 05:22:44 -0400 Received: from lists.gnu.org ([2001:470:142::17]:35700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTIvJ-0004qq-06 for submit@debbugs.gnu.org; Tue, 08 Aug 2023 05:22:43 -0400 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 1qTIvD-0006zB-La for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2023 05:22:35 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTIvB-0005cc-Mu for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2023 05:22:35 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-307d20548adso4130836f8f.0 for ; Tue, 08 Aug 2023 02:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691486551; x=1692091351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=SHN63ON0Wic3cR6cvGrVmuxTRr20l9tBRDFnYWImUzg=; b=Bok5dXmmY9Sg4Tq0O8z7a6mOJOTkKzAxWMozwYadUUGB00qOSRUtdWUW3OnAP4xKai BoTBfZcco+/jUJ73YdCUMk0t/Wja3IDYWIVq8/KSojgCMzXe8bdRkgWnI0Q7E6pQYW8c VBz68dnqOl4mumAfH6NKXoh3jguE8LKasO8JvtPdyHrL4rVQ7u/rrcZClbBuyb9jqjd0 F8RWf+pRd41o4ZwUQq8P/bPpJqV43sShkQbQFzygQj8rSic55FH4X1l4V1fxVsf8/DCx 0JrFo5vS7JQfDTaItloJLJyUnrMilAKpPEhovKiAMPfwPphp4ExedmtAeO7ZrtXL1jCm WgRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691486551; x=1692091351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SHN63ON0Wic3cR6cvGrVmuxTRr20l9tBRDFnYWImUzg=; b=cRQShO0ZLyFn24aeHbMaTI2bOjySuKl/8vYD4AIuZY2dsVUTmUH7LCaKQ5tBVdhOgr TDfKpZQp/WXC/sb56g4NjFn6AtDiMCN9VR1k8mGCO3O+ps8wZFwFwZ7c2OBbMukw5t4W GADWRK9JXvRuj9FznOr9sfuf9wWUjJPtDS60jZiAkGsrCGvv5u/RMT4mzGtxXWbau2gg z2pC3OsOa52zK9K4eZouiSOBb3mSKDp3Kn4rqFLpaYD+xCmkB3ZFegPLBXNgJGOIUqTI ZVfJbI+bZx/fShOzhdzo/VraHOKN4/+YmKqoJbLCe2c+Fl7iqhD0EerpWzeH7zOFPXiA 67iQ== X-Gm-Message-State: AOJu0Ywhal60B/BFSVhvZ90r75Q61npci6yz5S9ohrlAbYlZvxQ3gRz7 XA4rfQBVqHLyxltCu9AAooC1RpS07Xo= X-Google-Smtp-Source: AGHT+IHaUKqcIheF5q+y+fLDBORaR6KE0O1NHVN9hZ8wgLMZtqgqPyEnc/m7EhZ3eub3+fUWEC+Vzw== X-Received: by 2002:adf:facd:0:b0:315:ae39:27c with SMTP id a13-20020adffacd000000b00315ae39027cmr6058435wrs.70.1691486551300; Tue, 08 Aug 2023 02:22:31 -0700 (PDT) Received: from fedora.localnet (93-33-14-204.ip42.fastwebnet.it. [93.33.14.204]) by smtp.gmail.com with ESMTPSA id z9-20020a5d4c89000000b00317f3fd21b7sm2876783wrs.80.2023.08.08.02.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 02:22:31 -0700 (PDT) From: Vincenzo Pupillo To: bug-gnu-emacs@gnu.org, Danny Freeman Subject: Re: [PATCH] * lisp/progmodes/js.el Fix js-ts-mode indent bug in JSX expressions Date: Tue, 08 Aug 2023 11:22:29 +0200 Message-ID: <12267622.O9o76ZdvQC@fedora> In-Reply-To: <87tttak40q.fsf@dfreeman.email> References: <87tttak40q.fsf@dfreeman.email> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=v.pupillo@gmail.com; helo=mail-wr1-x431.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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi,=20 I confirm the bug and that the patch fixes it. Thank you Danny. Vincenzo Pupillo=20 In data luned=EC 7 agosto 2023 22:10:13 CEST, Danny Freeman ha scritto: > Tags: patch >=20 >=20 > Hello, >=20 > I have a patch for a bug I found in js-ts-mode. > When editing jsx blocks, the indentation does not work. >=20 > For example, in a file with the following file with JSX code in it > and js-ts-mode enabled >=20 > ``` > function App() { > return ( >
>
> ); > } > ``` >=20 > placing your cursor at the end of the opening div tag and pressing ENTER > does not indent, instead there is no indentation. >=20 > This patch corrects that by properly expanding the > `js-jsx--treesit-indent-compatibility-bb1f97b' function, which returns > some indent rules. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 10 05:03:44 2023 Received: (at 65134-done) by debbugs.gnu.org; 10 Aug 2023 09:03:45 +0000 Received: from localhost ([127.0.0.1]:41345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU1a4-0005rL-HA for submit@debbugs.gnu.org; Thu, 10 Aug 2023 05:03:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU1a1-0005r4-Oo for 65134-done@debbugs.gnu.org; Thu, 10 Aug 2023 05:03:42 -0400 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 1qU1Zv-0005KA-LJ; Thu, 10 Aug 2023 05:03:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yHBWetV1oDmcb9hsl+FMbCrzr1w85qtP4WX8PrTYY6s=; b=YRcghuPlXEyF 1+iYcQj1GHHTTZXbYFKkXC4zz25eqvETLEkVex5GIFFpOe/ZUCqAH1m9o1IhR6biMSUq9l8OHpV/Y /1k8CZU+kcS+zt8ALwiDt3WUSa3/1NxVbsElfVglD8idGfA+ROoAYSxpBdOqJyRdgxKTophnjLPm1 0Nno69OO9w5hO5D8zioz6WANa0fv4mMXTWUuFwOs9vpSwt4+cAnKORt+exEUYwh/d1m2DU5OLuFwp x/dznpRPdyZCokymcm+57D9dWb7T4pV3oZ/CquXwSB5Y0a7ATg3BNZk/p/nryqq0b2ouCi6D5rDlp NDZNgS6FyT+Ca8cdBJrh4A==; Date: Thu, 10 Aug 2023 12:03:16 +0300 Message-Id: <835y5njmln.fsf@gnu.org> From: Eli Zaretskii To: Vincenzo Pupillo In-Reply-To: <12267622.O9o76ZdvQC@fedora> (message from Vincenzo Pupillo on Tue, 08 Aug 2023 11:22:29 +0200) Subject: Re: bug#65134: [PATCH] * lisp/progmodes/js.el Fix js-ts-mode indent bug in JSX expressions References: <87tttak40q.fsf@dfreeman.email> <12267622.O9o76ZdvQC@fedora> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65134-done Cc: danny@dfreeman.email, 65134-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Vincenzo Pupillo > Date: Tue, 08 Aug 2023 11:22:29 +0200 > > I confirm the bug and that the patch fixes it. > Thank you Danny. Thanks for the patch and the review. I've now installed this on the emacs-29 branch, and I'm therefore closing the bug. From unknown Wed Jun 18 23:14:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 07 Sep 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator