GNU bug report logs - #61626
29.0.60; The indentation of switch case is broken on typescript-ts-mode and tsx-ts-mode

Previous Next

Package: emacs;

Reported by: Eason Huang <aqua0210 <at> foxmail.com>

Date: Sun, 19 Feb 2023 13:26:02 UTC

Severity: normal

Found in version 29.0.60

Full log


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

From: Yuan Fu <casouri <at> gmail.com>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: Eason Huang <aqua0210 <at> foxmail.com>, 61626 <at> debbugs.gnu.org
Subject: Re: bug#61626: 29.0.60; The indentation of switch case is broken on 
 typescript-ts-mode and tsx-ts-mode
Date: Sun, 26 Feb 2023 00:39:41 -0800

> On Feb 24, 2023, at 10:12 PM, Theodor Thornhill <theo <at> thornhill.no> wrote:
> 
> 
> 
> On 25 February 2023 06:00:45 CET, Yuan Fu <casouri <at> gmail.com> wrote:
>> 
>> Eason Huang <aqua0210 <at> foxmail.com> writes:
>> 
>>> Hello Theodor and Emacs dev team,
>>> 
>>> Recently I found that the indentation is broken in typescript-ts-mode
>>> and tsx-ts-mode. When I press RET (M-x newline) after the ':' in the
>>> case clause, it will always indent to the the same position of previouse line.
>>> 
>>> For example:
>>> In typescript-ts-mode and tsx-ts-mode will get this result as below:
>>> 
>>> ```
>>> let day: number = 1;
>>> 
>>> switch (day) {
>>> case 0:
>>> console.log("It is a Sunday.");
>>> break;
>>> case 1:
>>> console.log("It is a Monday.");
>>> break;
>>> default:
>>> console.log("No such day exists!");
>>> break;
>>> }
>>> ```
>>> expected:
>>> 
>>> ```
>>> let day: number = 1;
>>> 
>>> switch (day) {
>>> case 0:
>>>  console.log("It is a Sunday.");
>>>  break;
>>> case 1:
>>>  console.log("It is a Monday.");
>>>  break;
>>> default:
>>>  console.log("No such day exists!");
>>> break;
>>> }
>>> ```
>>> 
>>> steps to reprodue:
>>> 
>>> 1. start emacs with `emacs -Q`
>>> 2. C-x C-f ~/test.tsx to open a test.tsx
>>> 3. M-x typescript-ts-mode
>>> 4. input the exmaple code mentioned above
>>> 5. you will see the result.
>> 
>> The following patch should fix this, Theo, WDYT?
>> 
>> Yuan
>> 
> 
> This is already fixed:)

Oh! Glad I asked first ;-)

Yuan





This bug report was last modified 2 years and 166 days ago.

Previous Next


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