[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#68054: [PATCH] Add tree-sitter indent rule for lexical decls in js/t
From: |
Yuan Fu |
Subject: |
bug#68054: [PATCH] Add tree-sitter indent rule for lexical decls in js/typescript |
Date: |
Fri, 29 Dec 2023 20:24:13 -0800 |
> On Dec 26, 2023, at 10:21 PM, Noah Peart <noah.v.peart@gmail.com> wrote:
>
> Tags: patch
>
> * Bug: `js-ts-mode` and `typescript-ts-mode` are missing indentation
> rules for lexical declarations that span multiple lines.
>
> Recipe to reproduce:
>
> Using the following function to configure js-ts-mode and indent the
> buffer:
>
> (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)))
>
> Add the following example to a buffer and call `try-indent`.
>
> let foo = 1,
> bar = 2; // no indent rule matches this line
>
> No indentation is applied to the second line.
>
> 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’ll take a look tonight.
Yuan