GNU bug report logs - #78121
tsx-ts-mode: wrong indentation of body with misindented args

Previous Next

Package: emacs;

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

Date: Mon, 28 Apr 2025 16:17:05 UTC

Severity: normal

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

Full log


View this message in rfc822 format

From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: 78121 <at> debbugs.gnu.org
Subject: bug#78121: tsx-ts-mode: wrong indentation of body with misindented args
Date: Mon, 28 Apr 2025 23:15:35 +0700
Given this TypeScript:

    const updatePage = (a1: string,
                        a2: number) => {
      return true;
    }

upon attempting to indent the `return true;` line it becomes indented as:

    const updatePage = (a1: string,
                        a2: number) => {
                          return true;
    }

which isn't expected.

P.S.: I'd note separately that a2 gets indented to 2 spaces, which even though goes in line with VSCode, I am not sure if it's useful. Does anybody even indent the second param to "2 spaces" when 1st param resides much further align-wise? C and C++ modes align 2-nd param to the 1st one, python-mode does too. Should perhaps tsx-ts-mode handle that similarly as well?




This bug report was last modified 20 days ago.

Previous Next


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