bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61631: 29.0.60; The indentation of switch case is broken on typescri


From: Eason Huang
Subject: bug#61631: 29.0.60; The indentation of switch case is broken on typescript-ts-mode and tsx-ts-mode
Date: Mon, 20 Feb 2023 20:26:41 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Theodor Thornhill <theo@thornhill.no> writes:

> On 19 February 2023 14:24:30 CET, Eason Huang <aqua0210@foxmail.com> wrote:
>>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.
>>
>>--
>
>
> Great, thanks! I'll fix it tonight, unless you want to devise a patch 
> yourself?
>
Hi Theo,

Sorry, I have no idear how to fix it.

I tried the latest commit(fc4bfa76db9) of emacs-29 branch, but the issue is 
still existed.

-- 
Eason Huang





reply via email to

[Prev in Thread] Current Thread [Next in Thread]