From unknown Sun Aug 10 16:48:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#61626 <61626@debbugs.gnu.org> To: bug#61626 <61626@debbugs.gnu.org> Subject: Status: 29.0.60; The indentation of switch case is broken on typescript-ts-mode and tsx-ts-mode Reply-To: bug#61626 <61626@debbugs.gnu.org> Date: Sun, 10 Aug 2025 23:48:38 +0000 retitle 61626 29.0.60; The indentation of switch case is broken on typescri= pt-ts-mode and tsx-ts-mode reassign 61626 emacs submitter 61626 Eason Huang severity 61626 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 19 08:25:10 2023 Received: (at submit) by debbugs.gnu.org; 19 Feb 2023 13:25:10 +0000 Received: from localhost ([127.0.0.1]:45949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTjgj-0006Vv-Up for submit@debbugs.gnu.org; Sun, 19 Feb 2023 08:25:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:38510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTjgg-0006Vn-Vo for submit@debbugs.gnu.org; Sun, 19 Feb 2023 08:25:09 -0500 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 1pTjgb-0000vE-R3 for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2023 08:25:02 -0500 Received: from out203-205-221-242.mail.qq.com ([203.205.221.242]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTjgU-00061n-8r for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2023 08:24:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1676813078; bh=NkxWvtFhK7zg5/1iHq+cisWa/hYyqEJ9KAJeOKZbcTY=; h=From:To:Subject:Date; b=ajs43e0CR6QXOwD5yhjQ3wm6xCrUCdzhtWxHTWW0/QW0nH1yEYJ8feYe6li+Dg9yB 3brJGH10ZTxGWEmxr16cRC8vQhTMsWojSL9qsjFCbr6Saeq0NAPAvJaOWxN7LyKN56 5QuxlEU9OL3OJ4RjJk6HB7HweafXYn3EoGgCDHrI= Received: from macbook ([101.85.10.85]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id 625062A3; Sun, 19 Feb 2023 21:24:37 +0800 X-QQ-mid: xmsmtpt1676813077tqe5z60z0 Message-ID: X-QQ-XMAILINFO: MmPNY57tR1Xn76IYLv6sXRNWE5plQ6sZg51uKAL1rICkoXYJRFEXBuwYZ4VObM vIK9NEQNyQy69ziGAiQgydU9jy269BWwiRXhXFA/XTWJP7JkkA06kosALeueDq4DRgZzfP2ZnNUq IiG5CiN+xVgvNhoasEtlXSDEYgdcs8ZtOQZemXLdlJ2vzpHWyllaLMd96pzCpN7GjdsKJeLYGJFC HzhJL++bAwAFoQ8CyLZ3Yn0qP2EspaqSW1SxMMmk1gAXVNtFdsAPIdLASnnRZV+FcaqLU2xD3TNF 1y0EFz7wX2nfTM68IQGBOYRQye4z+98kLlhyAn2PvEZcmtwYN8UrU/NQJupfi3YFyn3Akwy7k9Sm m0VF2kDhxhXrq97MZwESIRnIrz76cFn+J3Cb2+apdiefYpBpq7/pUaHAwNeUpiwiKq7TG+v88dkL uqFTrhTMkJw9rQQUaf+4cIwlmmEwunBpn4UK/g1XQ+ai3RTYuIJ+Yx9dokjcdt4ENQIVcqx5cBkO CUwsiKEjkt8ZAvw2Oyj/VhZXkI/dXa9kShcD6KgANcPD1mKbWaedPeJBHOoD/8VKe8iobS/ZO/HJ d2kzB011k8bas9PkvsGlHgl4eraQMv/TR72/Opgbl5scbQZ4+lOQIee2QMJLCkokcV9J2MAkhcGB n+OrxXDS0DpOW3Y6gktNRGaSEzM59pYfQHSUEO0GMG784vQCV44zqiunMAJX3gDAnyVmCY+4Wvoz 7TwnIRbu1WHsYMy+OHYN87T0OUw3Q5ateEdvuHQ2J23UX9qZqsq9hVc3VMrterIq+ZLFo92TWlTp 47mZBobAe9SEfHC2fYhDhe9ZWrt9DOTfUwBXVGIroKpu8ofBomNlqANrbMhx6o19HCyf9wC8EcQD Empfif9xqF56yRdH0g+g2vzrA5NoZJE2uKUBMSsK40YLckp/c3UjEGHAKdPVIfnI9Eb0R4Aw4TQ7 zdIOFsEyeYLVaxyMiG63s3ZH3MC4ci From: Eason Huang To: bug-gnu-emacs@gnu.org, Theodor Thornhill Subject: 29.0.60; The indentation of switch case is broken on typescript-ts-mode and tsx-ts-mode Date: Sun, 19 Feb 2023 21:24:30 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=203.205.221.242; envelope-from=aqua0210@foxmail.com; helo=out203-205-221-242.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) 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. -- Eason Huang In GNU Emacs 29.0.60 (build 1, x86_64-apple-darwin22.2.0, NS appkit-2299.30 Version 13.1 (Build 22C65), git sha1 893ddd5903e) of 2023-02-19 built on macbook Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.1 Configured using: 'configure --without-native-compilation --without-dbus 'CPPFLAGS=-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath /opt/local/lib/gcc12 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64'' Configured features: ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: TypeScript Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils vc-git diff-mode easy-mmode vc-dispatcher typescript-ts-mode js c-ts-common json subr-x map byte-opt gv bytecomp byte-compile imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs treesit cl-seq cl-loaddefs cl-lib emacs-git-version rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 79887 12727) (symbols 48 8661 3) (strings 32 25763 2168) (string-bytes 1 934251) (vectors 16 16611) (vector-slots 8 226493 9391) (floats 8 29 58) (intervals 56 615 0) (buffers 984 14)) -- Eason Huang From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 00:01:06 2023 Received: (at 61626) by debbugs.gnu.org; 25 Feb 2023 05:01:06 +0000 Received: from localhost ([127.0.0.1]:38794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVmgD-0007F4-OK for submit@debbugs.gnu.org; Sat, 25 Feb 2023 00:01:06 -0500 Received: from mail-pl1-f171.google.com ([209.85.214.171]:33555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVmgB-0007EM-9I for 61626@debbugs.gnu.org; Sat, 25 Feb 2023 00:01:03 -0500 Received: by mail-pl1-f171.google.com with SMTP id p6so717599plf.0 for <61626@debbugs.gnu.org>; Fri, 24 Feb 2023 21:01:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=rRX+jzNS3aWzxaBdRj0RYawbmeJDkR39sG0hrXi4yvg=; b=JjCHB77xocCZtz3W67CZ+eK44mfDt53yOIAgxls/rhIwvr1LEd8wcfEjuk17TtGKz/ aAPoPa9uSQmzs7LjfBtM88+kHvNKVpjPxYqqmWyYPZIIbVoQlmGJjgG3t8VEEA2Asq8S Us6GzYqMqD132Qi0vJdbWfvrG5q8sykST2PUkoKW46VlG3p+rTteic1UYC4zxWeI+Bxc ia9Nwlh/NZ8b9JG/+OD3pVgNIZuaXY81qRGhMgHor9VJ7+r0xaEWQJlf8zDp6bT6b7L/ PA6ROQ4NIQgHo+f2dgMdwirf913RIFtCwIcwFrzFLfLBmfHW41vt3saupZd5zCJxg3Xd MZFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rRX+jzNS3aWzxaBdRj0RYawbmeJDkR39sG0hrXi4yvg=; b=eFNCZ5XtDgHbSXmqCqk6qlIeZaAz/TAuHGcY6WzAs+Gyw090Zeb7bhl5XorludBJtJ 3uD3qeAVGLmLUfxTNmmEGzOdZKu5HKcHPC5CZl/JHtHLmJr++15EZbF0tNu6LiElbpBj vXZEhdUP7HKUEChTHTyuNDXGkSpFrvGbkwnk0RD2x9gTzsqHyJIKXw/2jR6KDusa4+6Z RMTefG8qQKuEEgOl37+75cACTwRWs8m4agEuny+u9F/8NypDTccU1ndVkS5iY6wc1G0A iduOeVNggGf5ASDD6gY9uEZOfhbkY4H0zdQvrGZBAeODTOtkwojVQKumzgHJyVjYd907 IMCw== X-Gm-Message-State: AO0yUKXLMlsM60PZEDdNyAsi3GYw7dG1B1p7sBoV+oaDCe6CguhPHbvG gqUV3J3sTP9MlfIkel156+0= X-Google-Smtp-Source: AK7set9HpKIqMhJ5f2bUEcL0IMFVRPQOJ596oe8G2kWyV9dZNCmNMZUsN6M3sxdF8eYKtdQlKQ36Rw== X-Received: by 2002:a17:902:f547:b0:19a:81c1:e743 with SMTP id h7-20020a170902f54700b0019a81c1e743mr20107514plf.2.1677301257454; Fri, 24 Feb 2023 21:00:57 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id bd12-20020a170902830c00b0019afb7a02a1sm308372plb.218.2023.02.24.21.00.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2023 21:00:56 -0800 (PST) From: Yuan Fu Content-Type: multipart/mixed; boundary="Apple-Mail=_0A546D06-A0FF-45DC-A221-EC73732A09FD" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: bug#61626: 29.0.60; The indentation of switch case is broken on typescript-ts-mode and tsx-ts-mode Message-Id: Date: Fri, 24 Feb 2023 21:00:45 -0800 To: Eason Huang X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61626 Cc: theo@thornhill.no, 61626@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_0A546D06-A0FF-45DC-A221-EC73732A09FD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Eason Huang 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 =3D 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 =3D 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 --Apple-Mail=_0A546D06-A0FF-45DC-A221-EC73732A09FD Content-Disposition: attachment; filename=switch-case.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="switch-case.patch" Content-Transfer-Encoding: quoted-printable =46rom=206d42b7e63b39a18c027ad1115033704f4084e0b9=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Fri,=20= 24=20Feb=202023=2020:59:04=20-0800=0ASubject:=20[PATCH]=20Fix=20= switch-case=20indentation=20in=20typescript-ts-mode=20(bug#61626)=0A=0A*=20= lisp/progmodes/typescript-ts-mode.el:=0A= (typescript-ts-mode--indent-rules):=20Add=20indent=20rule=20for=20case=20= and=0Adefault.=0A---=0A=20lisp/progmodes/typescript-ts-mode.el=20|=206=20= ++++++=0A=201=20file=20changed,=206=20insertions(+)=0A=0Adiff=20--git=20= a/lisp/progmodes/typescript-ts-mode.el=20= b/lisp/progmodes/typescript-ts-mode.el=0Aindex=20= 5b49b8f50a8..1ce76cdf517=20100644=0A---=20= a/lisp/progmodes/typescript-ts-mode.el=0A+++=20= b/lisp/progmodes/typescript-ts-mode.el=0A@@=20-81,8=20+81,14=20@@=20= typescript-ts-mode--indent-rules=0A=20=20=20=20=20=20((parent-is=20= "member_expression")=20parent-bol=20typescript-ts-mode-indent-offset)=0A=20= =20=20=20=20=20((parent-is=20"named_imports")=20parent-bol=20= typescript-ts-mode-indent-offset)=0A=20=20=20=20=20=20((parent-is=20= "statement_block")=20parent-bol=20typescript-ts-mode-indent-offset)=0A+=20= =20=20=20=20;;=20Children=20under=20"case:"=0A=20=20=20=20=20=20= ((parent-is=20"switch_case")=20parent-bol=20= typescript-ts-mode-indent-offset)=0A+=20=20=20=20=20;;=20"case:"=0A+=20=20= =20=20=20((node-is=20"switch_case")=20parent-bol=200)=0A+=20=20=20=20=20= ;;=20Children=20under=20"default:"=0A=20=20=20=20=20=20((parent-is=20= "switch_default")=20parent-bol=20typescript-ts-mode-indent-offset)=0A+=20= =20=20=20=20;;=20"default:"=0A+=20=20=20=20=20((node-is=20= "switch_default")=20parent-bol=200)=0A=20=20=20=20=20=20((parent-is=20= "type_arguments")=20parent-bol=20typescript-ts-mode-indent-offset)=0A=20=20= =20=20=20=20((parent-is=20"variable_declarator")=20parent-bol=20= typescript-ts-mode-indent-offset)=0A=20=20=20=20=20=20((parent-is=20= "arguments")=20parent-bol=20typescript-ts-mode-indent-offset)=0A--=20=0A= 2.33.1=0A=0A= --Apple-Mail=_0A546D06-A0FF-45DC-A221-EC73732A09FD Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_0A546D06-A0FF-45DC-A221-EC73732A09FD-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 01:12:58 2023 Received: (at 61626) by debbugs.gnu.org; 25 Feb 2023 06:12:58 +0000 Received: from localhost ([127.0.0.1]:38844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVnnl-0000pa-T0 for submit@debbugs.gnu.org; Sat, 25 Feb 2023 01:12:58 -0500 Received: from out-45.mta1.migadu.com ([95.215.58.45]:40878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVnni-0000pP-Vk for 61626@debbugs.gnu.org; Sat, 25 Feb 2023 01:12:56 -0500 Date: Sat, 25 Feb 2023 07:12:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1677305573; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IBZ3zWEQ00l1ebK8z8ieOCam5QNzw/GCmbyOy+xcOu8=; b=TzTdoNIuTKUKt1AnijpWWqdhebV/WoOregBMBcPMfy9K7QrYpsTiO3S7vqLvfXVO4BuOdI 1H7Q1OUehzwTROwhx1MCX/A5tAq+i1nkSWK3wgIxwM7wq30o3l4DAvMJc44QnQHIll9goz jZP13oVsQzFS3dvJ/qouWdXDu9oRT2lfAEmr4VkWnTK27lR+iV+LDbfxMO3Z7bX27SxrVC gSpk7qGGFr3u8awkQZwYMNPMWexC8fqHSq42cAeEMV9f/qcXadgTEqhKLLWScmMsqdJJj3 yjI2dYjMIVKp4PD9CfEPhsom2v+LWD30YFhoF7DdiAqkEDyyAZH4Tfgeoo+aLQ== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill To: Yuan Fu , Eason Huang Subject: =?US-ASCII?Q?Re=3A_bug=2361626=3A_29=2E0=2E60=3B_T?= =?US-ASCII?Q?he_indentation_of_switch_c?= =?US-ASCII?Q?ase_is_broken_on__typescript-ts-mode_and_tsx-ts-mode?= In-Reply-To: References: Message-ID: <91CDFA4A-85CF-45D0-B36E-02D5534D7405@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61626 Cc: 61626@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 25 February 2023 06:00:45 CET, Yuan Fu wrote: > >Eason Huang writes: > >> Hello Theodor and Emacs dev team, >> >> Recently I found that the indentation is broken in typescript-ts-mode >> and tsx-ts-mode=2E When I press RET (M-x newline) after the ':' in the >> case clause, it will always indent to the the same position of previous= e line=2E >> >> For example: >> In typescript-ts-mode and tsx-ts-mode will get this result as below: >> >> ``` >> let day: number =3D 1; >> >> switch (day) { >> case 0: >> console=2Elog("It is a Sunday=2E"); >> break; >> case 1: >> console=2Elog("It is a Monday=2E"); >> break; >> default: >> console=2Elog("No such day exists!"); >> break; >> } >> ``` >> expected: >> >> ``` >> let day: number =3D 1; >> >> switch (day) { >> case 0: >> console=2Elog("It is a Sunday=2E"); >> break; >> case 1: >> console=2Elog("It is a Monday=2E"); >> break; >> default: >> console=2Elog("No such day exists!"); >> break; >> } >> ``` >> >> steps to reprodue: >> >> 1=2E start emacs with `emacs -Q` >> 2=2E C-x C-f ~/test=2Etsx to open a test=2Etsx >> 3=2E M-x typescript-ts-mode >> 4=2E input the exmaple code mentioned above >> 5=2E you will see the result=2E > >The following patch should fix this, Theo, WDYT? > >Yuan > This is already fixed:) From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 26 03:40:02 2023 Received: (at 61626) by debbugs.gnu.org; 26 Feb 2023 08:40:02 +0000 Received: from localhost ([127.0.0.1]:42310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWCZe-0005ZX-1P for submit@debbugs.gnu.org; Sun, 26 Feb 2023 03:40:02 -0500 Received: from mail-pl1-f180.google.com ([209.85.214.180]:45920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWCZb-0005Z6-2t for 61626@debbugs.gnu.org; Sun, 26 Feb 2023 03:40:01 -0500 Received: by mail-pl1-f180.google.com with SMTP id z2so3744627plf.12 for <61626@debbugs.gnu.org>; Sun, 26 Feb 2023 00:39:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=E0uLXUyRsqV1nET/3mlxlw5yblUCVUItPLQ01qk/j6s=; b=d8Hinwi8uEs8n+8m10YvsSCqFQ1ciuQWtxu7W9xSM3M3w22kkmw7WNSzKyk40A/VT7 qgl0C4Qf69gy/v88HUZhEldRfwEnam3WXzxXNqGgfriWcBXvPd394kj/EmxBFMwiBzE/ vhCTsVaiPYgtvAWSk2EkYg5XLO/qjDrDOZrFPvKmfog7cDydHfPYV3PlQySeioLbGVO3 o65Wc/hZRP667809HDe5sJhgUazugTGFLwQLSu3l0BpfPerebZoCeSQlh6lDrtzcufGH S2lWMi1idqPOtP3Ev8hwL78g2Z5UAgcR5bjP0nq1YRBONQ86QZfAHdc5BaLd4Io5PDuH MChg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E0uLXUyRsqV1nET/3mlxlw5yblUCVUItPLQ01qk/j6s=; b=lZiDddS7dFYjf3SrqkT73+biXp3PTtFE5hjGx8jHnccY8nF05t8+b5fwxM249wxTZH mia2b31GTtcPOEaHcn/lj/iz2phvKXkaGSBlyclog+U30QDKn0i1JR///To3TyM+J6Ci 13tdYwEDqVkPfhb7pQT49VK3xPTiHkR/MDEM5ziRTogrEZpOsue+95+bXUWOGsq/Fixg rPm6byUAtq0x9MVbXZHLgdShsHkzeJ5IcoPCrO31guvWUQL0o+IxgMGMVAp3HF89UkPG dX9uE26+kMxB/B9nHBoXLhQodSFf5oA98eyFm3k+shLDoMWJ03f+Fz9BkB/msWa6Fiid A8og== X-Gm-Message-State: AO0yUKUQlyx48KX7rXRAjOK5z8s9WfCMject6NZWOBnrlS70IWpSP9Ey B4sDIPvuyrvpt6IfalWflbI= X-Google-Smtp-Source: AK7set9HswAtptMewH+IHsUOZFw9oD8Cq/WQQwSHC5gkwdxRV3hX3QdwoquC2qTygSnu7Y2wQtHbDQ== X-Received: by 2002:a17:903:248:b0:19c:a9bc:ce57 with SMTP id j8-20020a170903024800b0019ca9bcce57mr17353027plh.64.1677400793067; Sun, 26 Feb 2023 00:39:53 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id jg15-20020a17090326cf00b0019adbef6a63sm2302675plb.235.2023.02.26.00.39.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Feb 2023 00:39:52 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: bug#61626: 29.0.60; The indentation of switch case is broken on typescript-ts-mode and tsx-ts-mode From: Yuan Fu In-Reply-To: <91CDFA4A-85CF-45D0-B36E-02D5534D7405@thornhill.no> Date: Sun, 26 Feb 2023 00:39:41 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <3651308B-8B87-4B57-8076-792F31590113@gmail.com> References: <91CDFA4A-85CF-45D0-B36E-02D5534D7405@thornhill.no> To: Theodor Thornhill X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61626 Cc: Eason Huang , 61626@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Feb 24, 2023, at 10:12 PM, Theodor Thornhill = wrote: >=20 >=20 >=20 > On 25 February 2023 06:00:45 CET, Yuan Fu wrote: >>=20 >> Eason Huang writes: >>=20 >>> Hello Theodor and Emacs dev team, >>>=20 >>> 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. >>>=20 >>> For example: >>> In typescript-ts-mode and tsx-ts-mode will get this result as below: >>>=20 >>> ``` >>> let day: number =3D 1; >>>=20 >>> 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: >>>=20 >>> ``` >>> let day: number =3D 1; >>>=20 >>> 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; >>> } >>> ``` >>>=20 >>> steps to reprodue: >>>=20 >>> 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. >>=20 >> The following patch should fix this, Theo, WDYT? >>=20 >> Yuan >>=20 >=20 > This is already fixed:) Oh! Glad I asked first ;-) Yuan