From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 13:37:45 +0100 Message-ID: <87cz64a4x2.fsf@thornhill.no> References: Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30774"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61631@debbugs.gnu.org To: Eason Huang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 20 13:38:34 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU5RA-0007m5-EK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Feb 2023 13:38:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU5Qk-0007fe-Rp; Mon, 20 Feb 2023 07:38:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU5Qh-0007eQ-H0 for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 07:38:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU5Qg-0005Zd-Bk for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 07:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pU5Qg-0001Jl-1D for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 07:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Feb 2023 12:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61631 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16768966755052 (code B ref -1); Mon, 20 Feb 2023 12:38:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Feb 2023 12:37:55 +0000 Original-Received: from localhost ([127.0.0.1]:50836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU5QY-0001JQ-Rj for submit@debbugs.gnu.org; Mon, 20 Feb 2023 07:37:55 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:56850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU5QW-0001JI-L2 for submit@debbugs.gnu.org; Mon, 20 Feb 2023 07:37:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU5QW-0007bI-7C for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 07:37:52 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU5QU-0005Xm-AZ for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 07:37:51 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1676896666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OUzxu/KOSdZN4YC6myjDozA2rmLDpLU5vSL1+jL6jD4=; b=HJ9gqWS8ynd2X9Q60n4J8WF5NVHpqJZhKLjWcXWeOnKG5N+SuvQ8IfSY35fuD/ne3x6fD3 jZ9RuMRJ+oGTnAmWSHnj448BIhpy37mjR9a4FS+F+Plq5BpOnjqxv+CjzZGOKL79ZvryS0 bSi9m03Yn69smaoAuvEr8pC6wHK2qVlVGy99KD9ptdNQz3/L2zxmQ9HK5i4Oz7ogkFFzA1 0zs/PKMCV4y3qgb3p46lwljKOJdBhM9HI+1Lbn5XGdG/gUURS3H1F10kObsbh9wsP/9mJu i3t1P96SmZMOcNiHLTUbfdDSVE765OlKb3YGsKxKSlUV9D8lqHmY3Inu6MCuCg== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256155 Archived-At: Eason Huang writes: > Theodor Thornhill writes: > >> On 19 February 2023 14:24:30 CET, Eason Huang 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 No problem, pushing it now. Theo