all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Noah Peart <noah.v.peart@gmail.com>
Cc: Dmitry Gutov <dmitry@gutov.dev>, 68054@debbugs.gnu.org
Subject: bug#68054: [PATCH] Add tree-sitter indent rule for lexical decls in js/typescript
Date: Mon, 22 Apr 2024 22:07:20 -0700	[thread overview]
Message-ID: <49231C5D-E89E-4AA3-AB02-51340994EA20@gmail.com> (raw)
In-Reply-To: <CAPVBTSeLOYuEH6je5AJcXU0cxj5Qjx-FNZdo9Zt5UAngaWbtFQ@mail.gmail.com>



> On Apr 17, 2024, at 1:21 PM, Noah Peart <noah.v.peart@gmail.com> wrote:
> 
> Sorry, I forgot about this. I've just added a rule to align the variable_declarators
> in let, var, and const declarations, but I need some feedback about the indentation
> for values in the variable_declarators following dangling '='.

Thanks!

> 
> For example, which of the following would be preferable?
> 
> 1) indent the dangling values with respect to start of the declaration
> 
>     const a =
>         (x: string): string => {
>             return x + x;
>         },
>           bbb =
>         {
>             "x": 0
>         },
>           cccc =
>         1,
>           ddddd = 0;
>   
> 2) indent them with respect to the start of the variable_declarator
> 
>     const a =
>               (x: string): string => {
>                   return x + x;
>               },
>           bbb =
>               {
>                   "x": 0
>               },
>           cccc =
>               1,
>           ddddd = 0;
> 
> 3) align with the variable declarators (this is the same as js-mode)
> 
>     const a =
>           (x: string): string => {
>               return x + x;
>           },
>           bbb =
>           {
>               "x": 0
>           },
>           cccc =
>           1,
>           ddddd = 0;
> 
> I've attached a patch with with the rules for the 3 options here.

I don’t really know what’s the convention, if there is one. Maybe Dmitry has better idea. Personally I like option 1.

Yuan




  reply	other threads:[~2024-04-23  5:07 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 [this message]
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
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=49231C5D-E89E-4AA3-AB02-51340994EA20@gmail.com \
    --to=casouri@gmail.com \
    --cc=68054@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=noah.v.peart@gmail.com \
    /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.