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#74386: Tree-sitter javascript indentation Date: Sat, 30 Nov 2024 21:23:22 -0800 Message-ID: <4B4B99E7-C4A1-4124-BC85-2AD66EF0871B@gmail.com> References: <2ce8c98e-c399-46f1-a930-04f27a3d56dd@gutov.dev> <389b6090-6ae9-433a-85cc-a2d2eb84751f@gutov.dev> <86r06t82gl.fsf@gnu.org> 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="16152"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , theo@thornhill.no, marius.kjeldahl@gmail.com, 74386@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 01 06:25:27 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 1tHcSU-000441-H8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Dec 2024 06:25:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHcS8-0006pG-9D; Sun, 01 Dec 2024 00: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 1tHcS7-0006p5-2w for bug-gnu-emacs@gnu.org; Sun, 01 Dec 2024 00:25: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 1tHcS6-0002p5-Pq for bug-gnu-emacs@gnu.org; Sun, 01 Dec 2024 00:25:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=V5k8lUkW1yMcs3vVhiINA5082mkyUUSQDVPpYTVEk+A=; b=NVXWxdfPZBS40AJiWyioFR2c6z3hVf/OLjW5T8PwnFRO33EY+ASQU7cWOqufa57Mufs207VODh0uT6hXsLnlRa3gaeLT+BDIxT8G14CJibN3xfQ0T1HiNqHm5AJlt0TKzGSqWXt+QyCF3tRWJo1GuJsBY5tuCGbjxqETpnhRzndMnFkFS+sxkLCKJdt+HYzK+xKFNGJiPCiNUiJjhVOgyIsToz9kqi9qznwn9gQPDzUoEUTYKyibIEh3hUUgOD8M1bCPrELy/c7LF85gkWTlpvlESbjdXo5Sni/8z+y+rAzM753WkoFUSTMBHHhkNYxbWQGT487iuvri24yi77p0rw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHcS6-0000yA-3w for bug-gnu-emacs@gnu.org; Sun, 01 Dec 2024 00:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Dec 2024 05:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74386 X-GNU-PR-Package: emacs Original-Received: via spool by 74386-submit@debbugs.gnu.org id=B74386.17330306813679 (code B ref 74386); Sun, 01 Dec 2024 05:25:02 +0000 Original-Received: (at 74386) by debbugs.gnu.org; 1 Dec 2024 05:24:41 +0000 Original-Received: from localhost ([127.0.0.1]:49876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHcRl-0000xH-3a for submit@debbugs.gnu.org; Sun, 01 Dec 2024 00:24:41 -0500 Original-Received: from mail-pj1-f41.google.com ([209.85.216.41]:61476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHcRi-0000x6-Iv for 74386@debbugs.gnu.org; Sun, 01 Dec 2024 00:24:39 -0500 Original-Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2ee8647dbb9so492682a91.2 for <74386@debbugs.gnu.org>; Sat, 30 Nov 2024 21:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733030617; x=1733635417; 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=V5k8lUkW1yMcs3vVhiINA5082mkyUUSQDVPpYTVEk+A=; b=ZvN7X1uHe6arVCjuOJeTk83opJEhFbk5jByyGoui27ufoYyRCT3KysGGNViNWtKj2Q wdtD/evXfppiHCsk3B1ofoVMlfBV2eJ7MftJBoB5+VN1wouTqubdlkhtBV/HllixQIUn RJ+4Js/Md6Ca/H0Y2f13w+iykhpoaiqQLs8REG8SYoV1gMMLFcV8d4TmU4LvOLl/dzVe 5Hry0HXYHcegardzb7BJYDXKEmuwmXOJZ0Rn3hlyVAb3eJQhltOMYUrV9WQ0ecB2pYgH tFC1ikjTMaYDCl0ijJL/g48Cjr9PL6cBcguOsELqBq1FndQIBvXGOnnZ/wyqS522nl1H i3cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733030617; x=1733635417; 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=V5k8lUkW1yMcs3vVhiINA5082mkyUUSQDVPpYTVEk+A=; b=XjgWv3g8Jex8HkxDzEhHKOQCi3cI3BQUMsGl4esilLWazM/9eQTURPiGM8oVpETmzJ C4csRERNTH2MWx/yBtyeGiUVdi6cBb8V2kIJILGWS8JJWb/AU0jIZyvEV727yGftlYP4 KD7ZPKNgs3HFyD2riqMf80TUW+2ucvp/LVADGCuuTwjOJAHO213gnOiJ3sqnkyJMuVl+ XUfslmBEX+5zNxTieWBRO3IHC89g8DyTu/mv8phHTHm52tf8mN2RFcy+gdFre3OhVMoD s/AktFbEu7Hm1zNRdzn9oUICbC4GaLm2HC+fhkrCrJboJdD5FB90GlKawYsm6xVBybGc qhpA== X-Forwarded-Encrypted: i=1; AJvYcCWEQqgKjrYYymQttPWjn6V8ZnYz0yuRpnLwO0x6nZiKbRW4tI7L/aOhtXA5KICbz9yqrGsuSQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzUehgQtn+B8wXtVqLJBy5+f8C2WPNVK1hA2+KkOkMB017WuRgR /jcxtSOI565rLuh6lxQYE3le/0XzPI/+9uzUJtw463FpZQW7aQ6s X-Gm-Gg: ASbGncvRBLfCi9QVXnJMBCzgHs4OVmJRIl4eSne1LX047Cd6FcKmGlRE6B8Qt8PVBeA oamO7E1QAEdEcypzmPachpjT3kq1OayXc4XA4g1RYtO7h7UzPy96tpqP+8/WkPz+Udq70Zada8q BWnbwk6Pf3CcacltLAB4no3UQSfdkGzV2XIGfSnGt9djDeuCzlkL+NCKqbilqlud7MJ+BlE7JrQ muN7jwsmfnT6iX9P2jjuYV8Q87sFE2qmhw82D1+EV/go5VJmDYM1Jem1C3zdTAvdROS4OmIAw== X-Google-Smtp-Source: AGHT+IFLp+LnCV7+5/POngOnoyFAmxD/b8U4XO6K2RshS9hp/oLcPn0Nue0qGcG/8HeD2NBGJT8HnQ== X-Received: by 2002:a17:90b:2fd0:b0:2ee:48bf:7dc3 with SMTP id 98e67ed59e1d1-2ee48bf7f80mr15944635a91.15.1733030617430; Sat, 30 Nov 2024 21:23:37 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:71b7:718f:7faa:8436]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee5a8a7f5csm3819609a91.14.2024.11.30.21.23.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Nov 2024 21:23:36 -0800 (PST) In-Reply-To: <86r06t82gl.fsf@gnu.org> X-Mailer: Apple Mail (2.3776.700.51) 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:296215 Archived-At: > On Nov 30, 2024, at 2:01=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> Cc: 74386@debbugs.gnu.org, Theodor Thornhill >> Date: Mon, 18 Nov 2024 17:29:18 +0200 >> From: Dmitry Gutov >>=20 >> On 18/11/2024 10:35, Marius Kjeldahl wrote: >>> Can confirm your patch solves both the variants I showed. This will >>> also help me to dig into and understand more of what is going on, = and >>> allows me to experiment more with my preferences (and tree-sitter in >>> general). So thank you very much. >>=20 >> Great! >>=20 >> For more experimenting, also check out 'M-x treesit-explore-mode'. >>=20 >> And here's how to immediately find out which indentation rule was = used: >>=20 >> (setq treesit--indent-verbose t) >=20 > Theo, please chime in. Should Dmitry install his changes? The standalone-parent anchor is designed specifically to solve the bug = described here, and changing parent-bol to standalone-parent is very = safe. So IMO we can merge this (either to emacs-30 or master). Yuan=