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


Message #8 received at 77803 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>,
 Theodor Thornhill <theo <at> thornhill.no>, Yuan Fu <casouri <at> gmail.com>
Cc: 77803 <at> debbugs.gnu.org
Subject: Re: bug#77803: tsx-ts-mode: wrong indentation for variables
 declarations
Date: Tue, 15 Apr 2025 12:02:47 +0300
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Date: Mon, 14 Apr 2025 18:41:42 +0300
> 
> Given this TypeScript snippet:
> 
>     const a = 1,
>           b = 2;
>     var c = 3,
>         d = 4;
> 
> …both b and d are expected to be indented to `typescript-ts-mode-indent-offset`
> (2 by default). This both makes logical sense and is the behavior in another
> editor VSCode.
> 
> Instead it gets indented to the length of `const` and `var` + space.
> 
> I'd note a separate problem: if you have this code:
> 
> 
>     const a = 1,
>       b = 2,
>           c = 3;
> 
> …and you try to indent `c`, instead of getting indented to the previous line it
> keeps being at "const + space" length.

Thanks.

Theo and Yuan, any suggestions or comments?




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.