GNU bug report logs - #77901
tsx-ts-mode: ternary chains are indented as a tree

Previous Next

Package: emacs;

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

Date: Fri, 18 Apr 2025 14:26:06 UTC

Severity: normal

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

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Yuan Fu <casouri <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#77901: closed (tsx-ts-mode: ternary chains are indented as a
 tree)
Date: Sun, 01 Jun 2025 23:18:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 1 Jun 2025 16:17:06 -0700
with message-id <4569E7A9-D209-42BF-A4BF-D616FA13B01C <at> gmail.com>
and subject line Re: bug#77901: tsx-ts-mode: ternary chains are indented as a tree
has caused the debbugs.gnu.org bug report #77901,
regarding tsx-ts-mode: ternary chains are indented as a tree
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
77901: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77901
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: tsx-ts-mode: ternary chains are indented as a tree
Date: Fri, 18 Apr 2025 17:06:34 +0300
Given this correctly indented code:

    const a = cond1 ? 1
      : cond2 ? 2
      : cond3 ? 3
      : 4;

if you reindent it, it turns into:

    const a = cond1 ? 1
      : cond2 ? 2
        : cond3 ? 3
          : 4;

Basically, for every colon it increases indentation. This is different
from other c-like languages (it's is indented as the first form
instead), and it's also different from Python. The "tree-indentation"
is not readable, so there's a reason other modes indent it as the
first example. Would it be possible to change in typescript mode as
well?


[Message part 3 (message/rfc822, inline)]
From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77901-done <at> debbugs.gnu.org, Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
Subject: Re: bug#77901: tsx-ts-mode: ternary chains are indented as a tree
Date: Sun, 1 Jun 2025 16:17:06 -0700

> On May 20, 2025, at 11:17 PM, Yuan Fu <casouri <at> gmail.com> wrote:
> 
> 
> 
>> On May 17, 2025, at 11:37 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> 
>>> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
>>> Cc: casouri <at> gmail.com, 77901 <at> debbugs.gnu.org
>>> Date: Sat, 17 May 2025 23:48:41 +0700
>>> 
>>> On Sat, 2025-05-17 at 13:10 +0300, Eli Zaretskii wrote:
>>>> Should this bug be closed now?
>>> 
>>> Well, my problem is solved, because I use style where colons start the
>>> line. But if someone uses style where colons remain on the previous
>>> line, more work is needed. I guess it makes sense to keep an issue for
>>> such case, the question only if it should go to its own issue, or may
>>> be solved here as well.
>> 
>> My question is, if we keep this open, who and how (and when) will
>> close it?
> 
> I’ll close it. But give me sometimes since I’m busy in real life right now ;-)
> 
> Yuan

Done by 8d132359d19

Yuan

This bug report was last modified 11 days ago.

Previous Next


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