Subject: bug#77901: closed (Re: bug#77901: tsx-ts-mode: ternary chains are indented as a tree)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 01 Jun 2025 23:18:02 +0000

Your bug report

#77901: tsx-ts-mode: ternary chains are indented as a tree

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
77901: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77901
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#77901: tsx-ts-mode: ternary chains are indented as a tree
From: Yuan Fu <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], Konstantin Kharlamov <[email-masked]>
Date: Sun, 1 Jun 2025 16:17:06 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

> On May 20, 2025, at 11:17 PM, Yuan Fu <[email-masked]> wrote:
> 
> 
> 
>> On May 17, 2025, at 11:37 AM, Eli Zaretskii <[email-masked]> wrote:
>> 
>>> From: Konstantin Kharlamov <[email-masked]>
>>> Cc: [email-masked], [email-masked]
>>> 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

Subject: tsx-ts-mode: ternary chains are indented as a tree
From: Konstantin Kharlamov <[email-masked]>
To: [email-masked]
Date: Fri, 18 Apr 2025 17:06:34 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

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?