From unknown Thu Aug 14 22:18:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71563: 30.0.50; {typescript,tsx}-ts-mode do not indent type parameter lists contents Resent-From: Arsen =?UTF-8?Q?Arsenovi=C4=87?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jun 2024 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71563 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 71563@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17183989386396 (code B ref -1); Fri, 14 Jun 2024 21:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jun 2024 21:02:18 +0000 Received: from localhost ([127.0.0.1]:44082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIE3s-0001ex-It for submit@debbugs.gnu.org; Fri, 14 Jun 2024 17:02:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:47978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIE3p-0001ej-LK for submit@debbugs.gnu.org; Fri, 14 Jun 2024 17:02:15 -0400 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 1sIDSb-0004Pd-Gg for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2024 16:23:45 -0400 Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1sIDSZ-00028Q-4b for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2024 16:23:45 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4W19hl3zJ8z9snL for ; Fri, 14 Jun 2024 22:23:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1718396615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RUKy7WkoQWAWotWuvI+5vdrt0uiWxnfpqCoxlBuxm1I=; b=cmHFaTwntoFGd4z4CFuhBHxVO0tkATrBe1BRPsxaN/jt0zT1ZKIeo+luwJGCsuiZWDo0BH uNjhY01IhG4QZFgip49yDkQ+RSQr1dA7mmtmrCpWafo2DNcIv7o50RaN8bDjrtlBnKuOMH oRTa0Rcb52R0fFF49IGXUVaWMe/3mYoEzK79WqTByCSum2GB1bNnSf8V7ordJEQKzo8IZ0 sBC3gNe4AQmQXu5uKMyZy/GYVKliFLUwI9l9IQ8VLHytQlVA2SXZeYeeCfBMzGibNHwMbf z4jlyS2UfGEqBr3YQ3KqqEPoV3Vmgc83Y+RGLZ244+4whwgxd+Vqopv36C8r+g== From: Arsen =?UTF-8?Q?Arsenovi=C4=87?= Date: Fri, 14 Jun 2024 22:23:31 +0200 Message-ID: <86jzirw9x8.fsf@aarsen.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:67c:2050:0:465::201; envelope-from=arsen@aarsen.me; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) 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.7 (--) Hi! The following snippet is considered correctly indented per typescript-ts-mode and tsx-ts-mode: --8<---------------cut here---------------start------------->8--- function f( a: int, b: int ) {} type T< A, B > =3D number f( a, b, c ) T< A, B, C > --8<---------------cut here---------------end--------------->8--- This seems inconsistent (and, subjectively, ugly). I think that the TS modes should indent type parameters the same as parameters (and the same as said arguments when they're being applied rather than declared). A patch that achieves the desired result (I am not sure of the correctness, but it does seem to do the right thing): --8<---------------cut here---------------start------------->8--- diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescri= pt-ts-mode.el index 74ed6aa2f94..3606a139d50 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -125,6 +125,7 @@ typescript-ts-mode--indent-rules ((parent-is "switch_case") parent-bol typescript-ts-mode-indent-offse= t) ((parent-is "switch_default") parent-bol typescript-ts-mode-indent-of= fset) ((parent-is "type_arguments") parent-bol typescript-ts-mode-indent-of= fset) + ((parent-is "type_parameters") parent-bol typescript-ts-mode-indent-o= ffset) ((parent-is ,(rx (or "variable" "lexical") "_" (or "declaration" "dec= larator"))) typescript-ts-mode--anchor-decl 1) ((parent-is "arguments") parent-bol typescript-ts-mode-indent-offset) --8<---------------cut here---------------end--------------->8--- Thank you for your continued maintenance of Emacs, and have a most lovely day! :) In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-06-10 built on localhost Repository revision: 12d44fe6420e84eab8f750f9a0f8cd73c3e70bb2 Repository branch: master System Description: Gentoo Linux Configured using: 'configure --prefix=3D/usr --build=3Dx86_64-pc-linux-gnu --host=3Dx86_64-pc-linux-gnu --mandir=3D/usr/share/man --infodir=3D/usr/share/info --datadir=3D/usr/share --sysconfdir=3D/etc --localstatedir=3D/var/lib --datarootdir=3D/usr/share --disable-silent-rules --docdir=3D/usr/share/doc/emacs-30.0.9999 --htmldir=3D/usr/share/doc/emacs-30.0.9999/html --libdir=3D/usr/lib64 --program-suffix=3D-emacs-30-vcs --includedir=3D/usr/include/emacs-30-vcs --infodir=3D/usr/share/info/emacs-30-vcs --localstatedir=3D/var --enable-locallisppath=3D/etc/emacs:/usr/share/emacs/site-lisp --without-compress-install --without-hesiod --without-pop --with-file-notification=3Dinotify --with-pdumper --enable-acl --enable-xattr --with-dbus --with-modules --with-gameuser=3D:gamestat --with-libgmp --with-gpm --with-native-compilation=3Daot --without-kerberos --without-kerberos5 --with-lcms2 --with-xml2 --with-mailutils --without-selinux --with-sqlite3 --with-gnutls --with-libsystemd --with-threads --with-tree-sitter --without-wide-int --with-sound=3Dalsa --with-zlib --with-pgtk --without-x --without-ns --with-toolkit-scroll-bars --without-gconf --without-gsettings --with-harfbuzz --with-libotf --with-m17n-flt --with-xwidgets --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-webp --without-imagemagick --with-dumping=3Dpdumper 'CFLAGS=3D-freport-bug -O3 -ggdb3 -pipe -fdiagnostics-color=3Dalways -march=3Dx86-64-v2 -flto -Werror=3Dodr -Werror=3Dlto-type-mismatch -Werror=3Dstrict-aliasing -fno-fast-math -ffp-contract=3Doff' CPPFLAGS=3D 'LDFLAGS=3D-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -O3 -Wl,-O3 -pipe -fdiagnostics-color=3Dalways -Wl,--defsym=3D__gentoo_check_ldflags__=3D0 -Wl,-z,pack-relative-relocs -Wl,--build-id -flto -Werror=3Dodr -Werror=3Dlto-type-mismatch -Werror=3Dstrict-aliasing'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB Important settings: value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: bug-reference-prog-mode: t global-git-commit-mode: t magit-auto-revert-mode: t server-mode: t auto-revert-mode: t global-jinx-mode: t jinx-mode: t display-line-numbers-mode: t ruler-mode: t diff-hl-flydiff-mode: t diff-hl-mode: t savehist-mode: t save-place-mode: t org-roam-db-autosync-mode: t desktop-save-mode: t global-hl-line-mode: t mu4e-modeline-mode: t ws-butler-global-mode: t ws-butler-mode: t corfu-popupinfo-mode: t global-corfu-mode: t corfu-mode: t marginalia-mode: t vertico-mouse-mode: t vertico-mode: t which-key-mode: t global-undo-tree-mode: t undo-tree-mode: t global-display-fill-column-indicator-mode: t display-fill-column-indicator-mode: t which-function-mode: t electric-pair-mode: t global-whitespace-mode: t whitespace-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-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 minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t auto-fill-function: do-auto-fill transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /usr/share/emacs/site-lisp/emacs-eat/eat hides /usr/share/emacs/site-lisp/e= macs-eat/term/eat /usr/share/emacs/site-lisp/transient/transient hides /usr/share/emacs/30.0.= 50/lisp/transient /usr/share/emacs/site-lisp/compat/compat hides /usr/share/emacs/30.0.50/lis= p/emacs-lisp/compat Features: (shadow emacsbug consult-register pulse consult-xref consult tramp-archive tramp-gvfs tramp trampver tramp-integration files-x tramp-message tramp-compat tramp-loaddefs vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs bug-reference face-remap magit-bookmark git-rebase magit-extras magit-sparse-checkout magit-gitignore magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util magit-subtree magit-patch magit-submodule magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit package url-handlers magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode git-commit log-edit add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor shell server magit-mode transient magit-git magit-base crm shr-color sort smiley gnus-cite qp mm-archive mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check misearch multi-isearch vertico-directory help-fns radix-tree info haskell-decl-scan haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-complete-module haskell-ghc-support flymake-proc etags fileloop xref dabbrev haskell-customize gitignore-mode conf-mode typescript-ts-mode js c-ts-common oc-basic ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi flycheck-pkgcheck autorevert filenotify flymake-cc flymake project jinx vc-git ebuild-mode skeleton display-line-numbers ruler-mode diff-hl-flydiff diff-hl log-view pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode track-changes cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs dired-aux savehist saveplace comp comp-cstr warnings org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam org-capture org-element org-persist xdg avl-tree generator org-attach org-id org-refile org-element-ast inline emacsql-sqlite advice emacsql emacsql-compiler magit-section cursor-sensor dash desktop frameset cus-load mu4e mu4e-org mu4e-notification notifications mu4e-main smtpmail mu4e-view mu4e-mime-parts mu4e-headers mu4e-thread mu4e-actions mu4e-compose mu4e-draft gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus comp-run comp-common gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win gnus nnheader range wid-edit mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message shr pixel-fill kinsoku url-file browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars mu4e-helpers mu4e-config mu4e-window bookmark pp ido message sendmail mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader mu4e-obsolete auth-source-pass ws-butler modus-vivendi-tinted-theme modus-themes kind-icon svg-lib svg dom xml corfu-popupinfo corfu orderless marginalia vertico-mouse vertico compat flycheck lisp-mnt org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie treesit executable ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities time-date org-version ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-compat org-macs format-spec which-key ace-window avy undo-tree diff queue display-fill-column-indicator disp-table which-func imenu elec-pair whitespace markdown-mode edit-indirect rx color url-parse auth-source eieio eieio-core password-cache json subr-x map url-vars thingatpt noutline outline icons edmacro kmacro byte-opt cl-macs gv cl-extra help-mode cl-seq use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core bytecomp byte-compile site-gentoo hs-lint compile text-property-search comint ansi-osc ansi-color ring preview-latex mmm-auto mmm-vars cl-loaddefs cl-lib mmm-utils mmm-compat ess-autoloads tex-site rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd 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 xwidget-internal dbusbind inotify dynamic-setting font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 1601145 2075291) (symbols 48 68255 17) (strings 32 258126 73109) (string-bytes 1 9012803) (vectors 16 139927) (vector-slots 8 1891203 12255= 47) (floats 8 879 9960) (intervals 56 42735 6368) (buffers 992 86)) <#secure method=3Dpgpmime mode=3Dsign> --=20 Arsen Arsenovi=C4=87 From unknown Thu Aug 14 22:18:04 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Arsen =?UTF-8?Q?Arsenovi=C4=87?= Subject: bug#71563: closed (Re: bug#71563: 30.0.50; {typescript,tsx}-ts-mode do not indent type parameter lists contents) Message-ID: References: <9ad40c0e-ea70-4172-808b-38c98560cf47@gutov.dev> <86jzirw9x8.fsf@aarsen.me> X-Gnu-PR-Message: they-closed 71563 X-Gnu-PR-Package: emacs Reply-To: 71563@debbugs.gnu.org Date: Fri, 14 Jun 2024 23:20:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1718407201-28142-1" This is a multi-part message in MIME format... ------------=_1718407201-28142-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #71563: 30.0.50; {typescript,tsx}-ts-mode do not indent type parameter list= s contents which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 71563@debbugs.gnu.org. --=20 71563: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71563 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1718407201-28142-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 71563-done) by debbugs.gnu.org; 14 Jun 2024 23:19:44 +0000 Received: from localhost ([127.0.0.1]:52232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIGCu-0007JA-Bw for submit@debbugs.gnu.org; Fri, 14 Jun 2024 19:19:44 -0400 Received: from wfout1-smtp.messagingengine.com ([64.147.123.144]:45515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIGCr-0007Io-Bo for 71563-done@debbugs.gnu.org; Fri, 14 Jun 2024 19:19:42 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id AFFDA1C000AA; Fri, 14 Jun 2024 19:19:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 14 Jun 2024 19:19:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1718407174; x=1718493574; bh=8Yj/Tonq32z3xvlBQ1FlGZiJqzUD+KjP1p01LNQ2i7c=; b= jDlG0PAaKux4gXvP3ljNisOgH2UzOl9SxE4g5duf8WHRMyTuWbLmOjBQVyTqw5VB 1W9ZUcz0bsctFtUKPwli6MEkDt094gXoGPSgbHNFSt0hnN0rRch8A4iHdB+XSQPu P2q54hdYfRx2XlcW9TeYp6vaJ2AFbRiemY77Cl2vFPV8Zm5pMtIxjwtFhuO36yx4 xfyYtYhLPcReLnjVVN3sGpw7XstJ87EUEa7Q/xen2YMC8B6/2pVpKAZdinx37JkN T89yWris0OlaM3u/DuQCt1rRonHmXdMOtbZsdKqNXnEXN2zhlHXDAkq0Nskf+2Ht DONl24Vro5Vvv1bLdPLSMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1718407174; x= 1718493574; bh=8Yj/Tonq32z3xvlBQ1FlGZiJqzUD+KjP1p01LNQ2i7c=; b=i TJYxhikDaQ6CluQ4ImJQutLh01VST/9/1YISWwdkDP8facisXt5lXSLAr+1mmIf8 AyeGAm/thKnpiHU4Ty0Ln0Kjab/7yT1H/9L9EWmfIPtj+ivGZGc/Bv0GvUc30+1h QunLrfnkEgkdCOa4QNo4crgVVqX2gVRYf8+vRIS5xdu2wL82X+Cj9uWVhaNIYB2w thgamfNoiMFx9uhNonxF8wRY0TULNIzedGxBVuuDTWaoQ3jwlb+Zu/3kM7xAgrFt PXm7OAeozi55G+yC3f22IDUbeJ+FMUgBplBZQ85z5PvjN7tRvKHaNbTj6gezXpkn N3y2Gnq0XA2aJS0Wks7yQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvtddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeegueegteffuddvjeevvdelleeitdeftdduhfeffeffjedukeevjedvfeffgfev geenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 14 Jun 2024 19:19:33 -0400 (EDT) Message-ID: <9ad40c0e-ea70-4172-808b-38c98560cf47@gutov.dev> Date: Sat, 15 Jun 2024 02:19:31 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71563: 30.0.50; {typescript,tsx}-ts-mode do not indent type parameter lists contents To: =?UTF-8?Q?Arsen_Arsenovi=C4=87?= , 71563-done@debbugs.gnu.org References: <86jzirw9x8.fsf@aarsen.me> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86jzirw9x8.fsf@aarsen.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71563-done 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.7 (-) Hi! On 14/06/2024 23:23, Arsen Arsenović via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > A patch that achieves the desired result (I am not sure of the > correctness, but it does seem to do the right thing): > > --8<---------------cut here---------------start------------->8--- > diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el > index 74ed6aa2f94..3606a139d50 100644 > --- a/lisp/progmodes/typescript-ts-mode.el > +++ b/lisp/progmodes/typescript-ts-mode.el > @@ -125,6 +125,7 @@ typescript-ts-mode--indent-rules > ((parent-is "switch_case") parent-bol typescript-ts-mode-indent-offset) > ((parent-is "switch_default") parent-bol typescript-ts-mode-indent-offset) > ((parent-is "type_arguments") parent-bol typescript-ts-mode-indent-offset) > + ((parent-is "type_parameters") parent-bol typescript-ts-mode-indent-offset) > ((parent-is ,(rx (or "variable" "lexical") "_" (or "declaration" "declarator"))) > typescript-ts-mode--anchor-decl 1) > ((parent-is "arguments") parent-bol typescript-ts-mode-indent-offset) > > --8<---------------cut here---------------end--------------->8--- > > Thank you for your continued maintenance of Emacs, and have a most > lovely day! 🙂 Thanks for the patch, pushed to master. ------------=_1718407201-28142-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 Jun 2024 21:02:18 +0000 Received: from localhost ([127.0.0.1]:44082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIE3s-0001ex-It for submit@debbugs.gnu.org; Fri, 14 Jun 2024 17:02:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:47978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIE3p-0001ej-LK for submit@debbugs.gnu.org; Fri, 14 Jun 2024 17:02:15 -0400 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 1sIDSb-0004Pd-Gg for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2024 16:23:45 -0400 Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1sIDSZ-00028Q-4b for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2024 16:23:45 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4W19hl3zJ8z9snL for ; Fri, 14 Jun 2024 22:23:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1718396615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RUKy7WkoQWAWotWuvI+5vdrt0uiWxnfpqCoxlBuxm1I=; b=cmHFaTwntoFGd4z4CFuhBHxVO0tkATrBe1BRPsxaN/jt0zT1ZKIeo+luwJGCsuiZWDo0BH uNjhY01IhG4QZFgip49yDkQ+RSQr1dA7mmtmrCpWafo2DNcIv7o50RaN8bDjrtlBnKuOMH oRTa0Rcb52R0fFF49IGXUVaWMe/3mYoEzK79WqTByCSum2GB1bNnSf8V7ordJEQKzo8IZ0 sBC3gNe4AQmQXu5uKMyZy/GYVKliFLUwI9l9IQ8VLHytQlVA2SXZeYeeCfBMzGibNHwMbf z4jlyS2UfGEqBr3YQ3KqqEPoV3Vmgc83Y+RGLZ244+4whwgxd+Vqopv36C8r+g== From: =?utf-8?Q?Arsen_Arsenovi=C4=87?= To: bug-gnu-emacs@gnu.org Subject: 30.0.50; {typescript,tsx}-ts-mode do not indent type parameter lists contents X-Debbugs-Cc: Date: Fri, 14 Jun 2024 22:23:31 +0200 Message-ID: <86jzirw9x8.fsf@aarsen.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:67c:2050:0:465::201; envelope-from=arsen@aarsen.me; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) 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.7 (--) Hi! The following snippet is considered correctly indented per typescript-ts-mode and tsx-ts-mode: --8<---------------cut here---------------start------------->8--- function f( a: int, b: int ) {} type T< A, B > =3D number f( a, b, c ) T< A, B, C > --8<---------------cut here---------------end--------------->8--- This seems inconsistent (and, subjectively, ugly). I think that the TS modes should indent type parameters the same as parameters (and the same as said arguments when they're being applied rather than declared). A patch that achieves the desired result (I am not sure of the correctness, but it does seem to do the right thing): --8<---------------cut here---------------start------------->8--- diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescri= pt-ts-mode.el index 74ed6aa2f94..3606a139d50 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -125,6 +125,7 @@ typescript-ts-mode--indent-rules ((parent-is "switch_case") parent-bol typescript-ts-mode-indent-offse= t) ((parent-is "switch_default") parent-bol typescript-ts-mode-indent-of= fset) ((parent-is "type_arguments") parent-bol typescript-ts-mode-indent-of= fset) + ((parent-is "type_parameters") parent-bol typescript-ts-mode-indent-o= ffset) ((parent-is ,(rx (or "variable" "lexical") "_" (or "declaration" "dec= larator"))) typescript-ts-mode--anchor-decl 1) ((parent-is "arguments") parent-bol typescript-ts-mode-indent-offset) --8<---------------cut here---------------end--------------->8--- Thank you for your continued maintenance of Emacs, and have a most lovely day! :) In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-06-10 built on localhost Repository revision: 12d44fe6420e84eab8f750f9a0f8cd73c3e70bb2 Repository branch: master System Description: Gentoo Linux Configured using: 'configure --prefix=3D/usr --build=3Dx86_64-pc-linux-gnu --host=3Dx86_64-pc-linux-gnu --mandir=3D/usr/share/man --infodir=3D/usr/share/info --datadir=3D/usr/share --sysconfdir=3D/etc --localstatedir=3D/var/lib --datarootdir=3D/usr/share --disable-silent-rules --docdir=3D/usr/share/doc/emacs-30.0.9999 --htmldir=3D/usr/share/doc/emacs-30.0.9999/html --libdir=3D/usr/lib64 --program-suffix=3D-emacs-30-vcs --includedir=3D/usr/include/emacs-30-vcs --infodir=3D/usr/share/info/emacs-30-vcs --localstatedir=3D/var --enable-locallisppath=3D/etc/emacs:/usr/share/emacs/site-lisp --without-compress-install --without-hesiod --without-pop --with-file-notification=3Dinotify --with-pdumper --enable-acl --enable-xattr --with-dbus --with-modules --with-gameuser=3D:gamestat --with-libgmp --with-gpm --with-native-compilation=3Daot --without-kerberos --without-kerberos5 --with-lcms2 --with-xml2 --with-mailutils --without-selinux --with-sqlite3 --with-gnutls --with-libsystemd --with-threads --with-tree-sitter --without-wide-int --with-sound=3Dalsa --with-zlib --with-pgtk --without-x --without-ns --with-toolkit-scroll-bars --without-gconf --without-gsettings --with-harfbuzz --with-libotf --with-m17n-flt --with-xwidgets --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-webp --without-imagemagick --with-dumping=3Dpdumper 'CFLAGS=3D-freport-bug -O3 -ggdb3 -pipe -fdiagnostics-color=3Dalways -march=3Dx86-64-v2 -flto -Werror=3Dodr -Werror=3Dlto-type-mismatch -Werror=3Dstrict-aliasing -fno-fast-math -ffp-contract=3Doff' CPPFLAGS=3D 'LDFLAGS=3D-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -O3 -Wl,-O3 -pipe -fdiagnostics-color=3Dalways -Wl,--defsym=3D__gentoo_check_ldflags__=3D0 -Wl,-z,pack-relative-relocs -Wl,--build-id -flto -Werror=3Dodr -Werror=3Dlto-type-mismatch -Werror=3Dstrict-aliasing'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB Important settings: value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: bug-reference-prog-mode: t global-git-commit-mode: t magit-auto-revert-mode: t server-mode: t auto-revert-mode: t global-jinx-mode: t jinx-mode: t display-line-numbers-mode: t ruler-mode: t diff-hl-flydiff-mode: t diff-hl-mode: t savehist-mode: t save-place-mode: t org-roam-db-autosync-mode: t desktop-save-mode: t global-hl-line-mode: t mu4e-modeline-mode: t ws-butler-global-mode: t ws-butler-mode: t corfu-popupinfo-mode: t global-corfu-mode: t corfu-mode: t marginalia-mode: t vertico-mouse-mode: t vertico-mode: t which-key-mode: t global-undo-tree-mode: t undo-tree-mode: t global-display-fill-column-indicator-mode: t display-fill-column-indicator-mode: t which-function-mode: t electric-pair-mode: t global-whitespace-mode: t whitespace-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-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 minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t auto-fill-function: do-auto-fill transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /usr/share/emacs/site-lisp/emacs-eat/eat hides /usr/share/emacs/site-lisp/e= macs-eat/term/eat /usr/share/emacs/site-lisp/transient/transient hides /usr/share/emacs/30.0.= 50/lisp/transient /usr/share/emacs/site-lisp/compat/compat hides /usr/share/emacs/30.0.50/lis= p/emacs-lisp/compat Features: (shadow emacsbug consult-register pulse consult-xref consult tramp-archive tramp-gvfs tramp trampver tramp-integration files-x tramp-message tramp-compat tramp-loaddefs vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs bug-reference face-remap magit-bookmark git-rebase magit-extras magit-sparse-checkout magit-gitignore magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util magit-subtree magit-patch magit-submodule magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit package url-handlers magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode git-commit log-edit add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor shell server magit-mode transient magit-git magit-base crm shr-color sort smiley gnus-cite qp mm-archive mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check misearch multi-isearch vertico-directory help-fns radix-tree info haskell-decl-scan haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-complete-module haskell-ghc-support flymake-proc etags fileloop xref dabbrev haskell-customize gitignore-mode conf-mode typescript-ts-mode js c-ts-common oc-basic ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi flycheck-pkgcheck autorevert filenotify flymake-cc flymake project jinx vc-git ebuild-mode skeleton display-line-numbers ruler-mode diff-hl-flydiff diff-hl log-view pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode track-changes cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs dired-aux savehist saveplace comp comp-cstr warnings org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam org-capture org-element org-persist xdg avl-tree generator org-attach org-id org-refile org-element-ast inline emacsql-sqlite advice emacsql emacsql-compiler magit-section cursor-sensor dash desktop frameset cus-load mu4e mu4e-org mu4e-notification notifications mu4e-main smtpmail mu4e-view mu4e-mime-parts mu4e-headers mu4e-thread mu4e-actions mu4e-compose mu4e-draft gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus comp-run comp-common gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win gnus nnheader range wid-edit mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message shr pixel-fill kinsoku url-file browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars mu4e-helpers mu4e-config mu4e-window bookmark pp ido message sendmail mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader mu4e-obsolete auth-source-pass ws-butler modus-vivendi-tinted-theme modus-themes kind-icon svg-lib svg dom xml corfu-popupinfo corfu orderless marginalia vertico-mouse vertico compat flycheck lisp-mnt org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie treesit executable ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities time-date org-version ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-compat org-macs format-spec which-key ace-window avy undo-tree diff queue display-fill-column-indicator disp-table which-func imenu elec-pair whitespace markdown-mode edit-indirect rx color url-parse auth-source eieio eieio-core password-cache json subr-x map url-vars thingatpt noutline outline icons edmacro kmacro byte-opt cl-macs gv cl-extra help-mode cl-seq use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core bytecomp byte-compile site-gentoo hs-lint compile text-property-search comint ansi-osc ansi-color ring preview-latex mmm-auto mmm-vars cl-loaddefs cl-lib mmm-utils mmm-compat ess-autoloads tex-site rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd 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 xwidget-internal dbusbind inotify dynamic-setting font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 1601145 2075291) (symbols 48 68255 17) (strings 32 258126 73109) (string-bytes 1 9012803) (vectors 16 139927) (vector-slots 8 1891203 12255= 47) (floats 8 879 9960) (intervals 56 42735 6368) (buffers 992 86)) <#secure method=3Dpgpmime mode=3Dsign> --=20 Arsen Arsenovi=C4=87 ------------=_1718407201-28142-1--