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: Dmitry Gutov <dmitry <at> gutov.dev>
To: Yuan Fu <casouri <at> gmail.com>
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: Tue, 22 Apr 2025 01:43:30 +0300
On 20/04/2025 07:36, Yuan Fu wrote:
> 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?

Back when js2-mode used its own indentation code, we called it 
js2-pretty-multiline-declarations, and it wasn't just a boolean (one 
possible symbol value too):

https://github.com/mooz/js2-mode/blob/master/js2-old-indent.el#L75C12-L115

I don't have a strong opinion on the name, but just in case we'll want 
to support a third way maybe don't call it with '-p' at the end.

Also, it might be good to have the variable affect js-mode as well (and 
so it wouldn't need -ts- in the name) - it's just an extra check around 
the (js--multi-line-declaration-indentation) call inside 
js--proper-indentation.

Are there other js-mode indentation vars that affect js-ts-mode?




This bug report was last modified 73 days ago.

Previous Next


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