all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noah Peart <noah.v.peart@gmail.com>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: Yuan Fu <casouri@gmail.com>, 68054@debbugs.gnu.org
Subject: bug#68054: [PATCH] Add tree-sitter indent rule for lexical decls in js/typescript
Date: Thu, 25 Apr 2024 15:48:37 -0700	[thread overview]
Message-ID: <CAPVBTSdR5UqtJtmzREvEUAGh6+gKKEq_+WF0L1hxb_KuPDgRGw@mail.gmail.com> (raw)
In-Reply-To: <3cf27c4d-d5ee-423c-a0d2-cfae297d36ae@gutov.dev>

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

Ok, I can make a patch for option 3 (the same as js-mode) instead. It's
implementation is the simplest also.  Would that work?

Thanks

On Wed, Apr 24, 2024 at 4:15 PM Dmitry Gutov <dmitry@gutov.dev> wrote:

> On 24/04/2024 05:36, Noah Peart wrote:
> >  > What js-mode does (looks like 3) shouldn't be too bad, but I wouldn't
> > mind an extra indentation level for such cases, too (example 2).
> >
> > The problem I found with option 2/3 was cases like the following (which
> > also seem like the most common) where I expect the start of
> > the function be indented according to `typescript-ts-mode-indent-offset`,
> > not with the declaration keyword "const" as in `js-mode` (and option 3).
> >
> >      const someFuncWithReallyLongName =
> >        async (x: number, y: number, z: number): Promise<void> => {
> >          // ...
> >        };
>
> I don't know, in my understanding the line break after the "=" (or its
> absence) is usually a good enough look to choose between indentation
> offsets for a given statement. I.e. with the break after = it would be
> indented deeply, and without it (keeping "async" on the first line) the
> body would have the same base indentation as the "const" statement.
>
> Though of course some users like it differently anyway.
>

[-- Attachment #2: Type: text/html, Size: 1788 bytes --]

  reply	other threads:[~2024-04-25 22:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27  6:21 bug#68054: [PATCH] Add tree-sitter indent rule for lexical decls in js/typescript Noah Peart
2023-12-30  4:24 ` Yuan Fu
2023-12-30 20:31   ` Yuan Fu
2023-12-31  0:31     ` Dmitry Gutov
2023-12-31  5:35       ` Noah Peart
2023-12-31 13:41         ` Dmitry Gutov
2024-01-01  4:56           ` Yuan Fu
2024-04-17 20:21             ` Noah Peart
2024-04-23  5:07               ` Yuan Fu
2024-04-24  0:15                 ` Dmitry Gutov
2024-04-24  2:36                   ` Noah Peart
2024-04-24 23:15                     ` Dmitry Gutov
2024-04-25 22:48                       ` Noah Peart [this message]
2024-04-26  1:06                         ` Dmitry Gutov
2024-05-02 13:26                           ` Noah Peart
2024-05-02 13:38                             ` Noah Peart
2024-05-18  8:29                               ` Eli Zaretskii
2024-06-09  2:52                               ` Dmitry Gutov
2024-06-09  2:48                             ` Dmitry Gutov
2024-06-09  6:15                               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPVBTSdR5UqtJtmzREvEUAGh6+gKKEq_+WF0L1hxb_KuPDgRGw@mail.gmail.com \
    --to=noah.v.peart@gmail.com \
    --cc=68054@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=dmitry@gutov.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.