GNU bug report logs - #61503
29.0.60; js-ts-mode indent incorrect for multiline strings

Previous Next

Package: emacs;

Reported by: Geoff Jacobsen <geoffjacobsen <at> gmail.com>

Date: Tue, 14 Feb 2023 06:32:02 UTC

Severity: normal

Found in version 29.0.60

Fixed in version 29.1

Done: Theodor Thornhill <theo <at> thornhill.no>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61503 in the body.
You can then email your comments to 61503 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61503; Package emacs. (Tue, 14 Feb 2023 06:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Geoff Jacobsen <geoffjacobsen <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 14 Feb 2023 06:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Geoff Jacobsen <geoffjacobsen <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; js-ts-mode indent incorrect for multiline strings
Date: Tue, 14 Feb 2023 19:30:42 +1300
[Message part 1 (text/plain, inline)]
When a multiline (backquote) string is defined in a buffer, with
major-mode js-ts-mode, the indent function incorrectly indents the
contents of the string. It should not alter the contents of the string.

Example:

const a = {
  b: `1
2
3
`};

is incorrectly changed to:

const a = {
  b: `1
  2
  3
`};




In GNU Emacs 29.0.60 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.16.0) of 2023-02-08 built on kataki.jacott
Repository revision: c9ba05af8dfabca00023bd2312dec4ec59497801
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.10

Configured using:
 'configure --with-json --with-imagemagick --with-native-compilation
 --with-x'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK
JPEG JSON LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: en_NZ.UTF-8
  value of $LC_NUMERIC: en_NZ.UTF-8
  value of $LC_TIME: en_NZ.UTF-8
  value of $LANG: en_AU.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Messages

Minor modes in effect:
  desktop-save-mode: t
  override-global-mode: t
  TeX-PDF-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  server-mode: t
  windmove-mode: t
  save-place-mode: t
  pixel-scroll-precision-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/geoffj/.emacs.d/elpa/transient-20230213.1337/transient hides
/usr/local/share/emacs/29.0.60/lisp/transient
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package-core hides
/usr/local/share/emacs/29.0.60/lisp/use-package/use-package-core
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package-delight
hides /usr/local/share/emacs/29.0.60/lisp/use-package/use-package-delight
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package-ensure
hides /usr/local/share/emacs/29.0.60/lisp/use-package/use-package-ensure
/home/geoffj/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides
/usr/local/share/emacs/29.0.60/lisp/use-package/bind-key
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package-jump hides
/usr/local/share/emacs/29.0.60/lisp/use-package/use-package-jump
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package-diminish
hides /usr/local/share/emacs/29.0.60/lisp/use-package/use-package-diminish
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package-bind-key
hides /usr/local/share/emacs/29.0.60/lisp/use-package/use-package-bind-key
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package-lint hides
/usr/local/share/emacs/29.0.60/lisp/use-package/use-package-lint
/home/geoffj/.emacs.d/elpa/use-package-20230203.2004/use-package hides
/usr/local/share/emacs/29.0.60/lisp/use-package/use-package

Features:
(mailalias mailclient textsec uni-scripts idna-mapping ucs-normalize
uni-confusable textsec-check ispell easy-kill shadow sort mail-extr
emacsbug tabify dabbrev vc-annotate vc magit-patch magit-subtree
magit-gitignore magit-ediff magit-extras face-remap cus-edit cus-start
wid-edit ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util let-alist files-x benchmark loaddefs-gen lisp-mnt
tar-mode arc-mode archive-mode cl-print misearch multi-isearch
mm-archive gnutls mule-util network-stream url-cache url-http url-auth
url-gw nsm display-line-numbers pulse help-fns radix-tree jka-compr
dired-aux company-oddmuse company-keywords company-etags etags fileloop
xref company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb vc-git vc-dispatcher desktop frameset
use-package-bind-key bind-key use-package-ensure use-package-core
mycolors-theme latex latex-flymake flymake-proc flymake project
tex-ispell tex-style tex dbus xml texmathp tex-mode markdown-mode color
thingatpt noutline outline advice browse-kill-ring delsel koru
koru-find-source koru-require koru-complete koru-test
koru-project-layout koru-server websocket bindat koru-process koru-core
koru-js generator company pcase yasnippet magit-bookmark magit-submodule
magit-obsolete 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
magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff diff-mode easy-mmode git-commit log-edit message
sendmail yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config
gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert
autorevert filenotify magit-margin magit-transient magit-process
with-editor comp comp-cstr warnings icons rx shell pcomplete server
magit-mode transient cl-extra edmacro kmacro help-mode magit-git
magit-base magit-section format-spec crm dash compat js c-ts-common
treesit imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs unit-test view gj-extensions derived
windmove dired dired-loaddefs bookmark pp saveplace pixel-scroll
cua-base ido grep compile text-property-search comint ansi-osc
ansi-color ring cus-load finder-inf company-autoloads magit-autoloads
git-commit-autoloads with-editor-autoloads transient-autoloads
lsp-mode-autoloads use-package-autoloads bind-key-autoloads
bash-completion-autoloads markdown-mode-autoloads
magit-section-autoloads compat-autoloads info tex-site package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-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 dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 2326891 930870)
 (symbols 48 40545 92)
 (strings 32 327035 213388)
 (string-bytes 1 15852555)
 (vectors 16 131896)
 (vector-slots 8 1879770 795659)
 (floats 8 455 1599)
 (intervals 56 207887 19266)
 (buffers 984 89))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61503; Package emacs. (Tue, 14 Feb 2023 19:57:01 GMT) Full text and rfc822 format available.

Message #8 received at 61503 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Geoff Jacobsen <geoffjacobsen <at> gmail.com>
Cc: 61503 <at> debbugs.gnu.org
Subject: Re: bug#61503: 29.0.60; js-ts-mode indent incorrect for multiline
 strings
Date: Tue, 14 Feb 2023 20:56:55 +0100
Geoff Jacobsen <geoffjacobsen <at> gmail.com> writes:

> When a multiline (backquote) string is defined in a buffer, with
> major-mode js-ts-mode, the indent function incorrectly indents the
> contents of the string. It should not alter the contents of the string.
>
> Example:
>
> const a = {
>   b: `1
> 2
> 3
> `};
>
> is incorrectly changed to:
>
> const a = {
>   b: `1
>   2
>   3
> `};

Hi! Thanks for your report!

It should be fixed now on latest emacs-29 branch :-)

Theo




bug marked as fixed in version 29.1, send any further explanations to 61503 <at> debbugs.gnu.org and Geoff Jacobsen <geoffjacobsen <at> gmail.com> Request was from Theodor Thornhill <theo <at> thornhill.no> to control <at> debbugs.gnu.org. (Tue, 14 Feb 2023 19:58:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Mar 2023 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.