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 15:04:49 +0100 Message-ID: <87a618a0vy.fsf@thornhill.no> References: <87cz64a4x2.fsf@thornhill.no> 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="18732"; 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 15:06:26 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 1pU6oD-0004dz-Tb for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Feb 2023 15:06:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU6ns-00019w-RI; Mon, 20 Feb 2023 09:06:04 -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 1pU6nq-00019c-8b for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:06:02 -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 1pU6np-0001Bh-Vf for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pU6np-0003nX-QB for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:06:01 -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 14:06: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.167690190414516 (code B ref -1); Mon, 20 Feb 2023 14:06:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Feb 2023 14:05:04 +0000 Original-Received: from localhost ([127.0.0.1]:51052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU6mt-0003m4-Q6 for submit@debbugs.gnu.org; Mon, 20 Feb 2023 09:05:04 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:48900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU6mp-0003lY-AF for submit@debbugs.gnu.org; Mon, 20 Feb 2023 09:05:01 -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 1pU6mp-0000uF-4e for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:04:59 -0500 Original-Received: from out-15.mta1.migadu.com ([2001:41d0:203:375::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU6mm-0000m7-4t for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:04:58 -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=1676901891; 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=ZHOzNesoEsiSUMqPixrPdCw11J0EmK491z7xvVk1j+4=; b=0DBIGUUFOq5WIzKrn4446Yvy9kBHpyrWLOSB0gD6JZLV8J0wEn+5XxZYrd4xa/lpFGruvf 3ZL8rFw3NNGYx0E2vP2o2qSbkqBULERBVoh05mzoMB46C4lDHQW3QVR5a0WsnMWNHQbPEz p31PTSRrm3ZXlSmpUOF0zxQ0jLrjDy/BVR93SKKmYPYHkOdcYY6QvW9Ree4ZYZ4kRWpH0Q lYEzqIGB1Ua3WwZCIWx/VZbQgEfC+82Z/ZLZw6bWfTU+1wNPLas7A2vvd2p+qojPs3rLga uEn3YUkU/FGdU+IzMG86CE6/HdEk62WwZ7sRxH2bBA+Puyk+Hdc0vv/ilS101A== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::f; envelope-from=theo@thornhill.no; helo=out-15.mta1.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_NONE=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:256173 Archived-At: Eason Huang writes: > Theodor Thornhill writes: > >> 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. >> > > Great, thanks! > > I just build commit 19480aa30e3, and the issue has been fixed now. > > -- > Eason Huang Good news! theo