GNU bug report logs - #77803
tsx-ts-mode: wrong indentation for variables declarations

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Mon, 14 Apr 2025 15:43:01 UTC

Severity: normal

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 77803 <at> debbugs.gnu.org, Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
Subject: bug#77803: [PATCH v2] Don't indent variable names to their declarator expression (bug#77803)
Date: Sat, 19 Apr 2025 21:36:43 -0700

> On Apr 19, 2025, at 5:38 PM, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
> 
> On 20/04/2025 01:58, Konstantin Kharlamov wrote:
> 
>>> https://github.com/mooz/js2-mode/issues/1 is when it was added, then
>>> see
>>> other reports in the tracker about refining it and adding support for
>>> different cases.
>> Oooh… it seems to be a misunderstanding. The user wasn't asking to
>> indent every declaration to the declarator (as it was in ts-tsx-mode
>> and as it seems now in jsx-mode). The user pointed out the indentation
>> wasn't working at all, and showed "expected indentation", where there
>> are 4 spaces used; however it is an accident that 4 spaces are equal to
>> "var" + space.
> 
> There were no protests from the user, and as I said, you can search the tracker for other requests for refining this indentation method.
> 
> Or see https://debbugs.gnu.org/8576, for when this feature was added to js-mode.

I can add a custom option that toggle this. We don’t need indentation styles for js, C/C++ is probably the only language that has that many established indentation styles. What would be a good name for the option? This custom option will be used for both js-ts-mode and jsx-ts-mode. js-ts-indent-align-multi-assignment-p?

Yuan





This bug report was last modified 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.