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#68054: [PATCH] Add tree-sitter indent rule for lexical decls in js/typescript Date: Fri, 29 Dec 2023 20:24:13 -0800 Message-ID: <797AC075-B0C8-4269-B8E3-A1F2C69FA955@gmail.com> References: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) 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="30830"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68054@debbugs.gnu.org To: Noah Peart Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 30 05:25:13 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 1rJQuO-0007ok-NG for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Dec 2023 05:25:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJQuG-0002yJ-9d; Fri, 29 Dec 2023 23:25: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 1rJQuD-0002um-RW for bug-gnu-emacs@gnu.org; Fri, 29 Dec 2023 23:25:01 -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 1rJQuD-0003yr-I7 for bug-gnu-emacs@gnu.org; Fri, 29 Dec 2023 23:25:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJQuD-0006B4-JY for bug-gnu-emacs@gnu.org; Fri, 29 Dec 2023 23:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2023 04:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68054 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68054-submit@debbugs.gnu.org id=B68054.170391027323703 (code B ref 68054); Sat, 30 Dec 2023 04:25:01 +0000 Original-Received: (at 68054) by debbugs.gnu.org; 30 Dec 2023 04:24:33 +0000 Original-Received: from localhost ([127.0.0.1]:42793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJQtk-0006AF-K4 for submit@debbugs.gnu.org; Fri, 29 Dec 2023 23:24:32 -0500 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:49429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJQti-0006A2-PB for 68054@debbugs.gnu.org; Fri, 29 Dec 2023 23:24:31 -0500 Original-Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1d3e8a51e6bso55596155ad.3 for <68054@debbugs.gnu.org>; Fri, 29 Dec 2023 20:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703910264; x=1704515064; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mhMRcyoxUd27Lmm1U+vt4LBEADE4GRanYl3DVbxN2/A=; b=NvOzhPk/7NHkpI1zdy7xodWs2g+wHMvVx7HqGxmyZxvlrn+y8UP8kaX0PB7JzCUjbG vzBuj7mhd+eT7DJHgnZmj1pJvvU49Fuf0SlnrkAs7El7WTVgl53bjig2q77I3j2FuFMy yp0IURUQXkGrL8L1NA1vsf+6sRg8lRsKl3ONU61XNxHBa9H8eMha66ZYp9UQyrQLH0Fx /8kTNuAqx+AW0AyLXam/whqga96HU0Q56Sq4bNX1DahyR8UkhuEw/M4jO78q9QSWwc7u Lj5Gvrle4i4n7w0kboKoDAjBFpxRqWq/5qQAIgwka6OGe2a35Jf3+gu1eGf62wextDAR kYqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703910264; x=1704515064; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mhMRcyoxUd27Lmm1U+vt4LBEADE4GRanYl3DVbxN2/A=; b=I/0itInL8d7Mm7Q0gxt5d7hjjXmwmmtFVT+HDVxArm7wW/UL80IQxr5muGbp4KpDrM nSwOiuhHHzuwuedvFNoSu2GuBZ+Rn/oNYcUVZ3Bla4CD5cbWVkjPOfsdNpEdHLaBYDRr 9xWEM7hL05H+HDywjd+QEho8CWDhNk3knl2BZOPssEqssmMaLcStwORBh+0J4KS7squj X37AU8g+CpO3vvR98rTYJxNEZ//lpFEltVfSLhxnCtT/qoEaRhYVu/beRE2lMoex8A+G 1YF5/J+oy1a62bNezlOSQwKKL2OhVzAOFbQ0Zo30XbrgjufwjPI2FNqTaAO1mcQ71cIt YR4A== X-Gm-Message-State: AOJu0YznfZ+/AbKjAyh66OqhfNmZy90jyuRoZuEM6aCVfA7rOkgLnUJN hCk3sFm8MG/G8YSHBM6c7Uw= X-Google-Smtp-Source: AGHT+IHk+ONWqe+f//Ob1oPbHm/L3sHnqmDlDHQV343djsZQYFWkTRP7eS/e+MTUc1UrQYzYUrAnKw== X-Received: by 2002:a17:903:1107:b0:1d4:85a8:3e93 with SMTP id n7-20020a170903110700b001d485a83e93mr5304071plh.106.1703910264499; Fri, 29 Dec 2023 20:24:24 -0800 (PST) Original-Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id jg11-20020a17090326cb00b001d3ef9edfa7sm16495479plb.58.2023.12.29.20.24.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Dec 2023 20:24:24 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3731.700.6) 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:277053 Archived-At: > On Dec 26, 2023, at 10:21 PM, Noah Peart = wrote: >=20 > Tags: patch >=20 > * Bug: `js-ts-mode` and `typescript-ts-mode` are missing indentation > rules for lexical declarations that span multiple lines. >=20 > Recipe to reproduce: >=20 > Using the following function to configure js-ts-mode and indent the > buffer: >=20 > (defun try-indent () > (interactive) > (js-ts-mode) > (setq-local indent-tabs-mode nil) > (setq-local js-indent-level 4) > (indent-region (point-min) (point-max))) >=20 > Add the following example to a buffer and call `try-indent`. >=20 > let foo =3D 1, > bar =3D 2; // no indent rule matches this line >=20 > No indentation is applied to the second line. >=20 > This patch adds a simple indentation rules for `js-ts-mode` and > `typescript-ts-mode` to handle the multi-line lexical declarations. Thanks, and sorry for not seeing this. I=E2=80=99ll take a look tonight. Yuan=