Subject: bug#67556: 29.1; java-ts-mode doesn't indent open curly brackets properly

From: Spencer Pavkovic <[email-masked]>
Date: Thu, 30 Nov 2023 16:28:11 -0600

If you are in java-ts-mode, attempting to put an opening curly bracket
'{' on it's own line will not indent the bracket at all.

While I expect it to place the bracket on the same indent level as the
block (like regular java-mode), it is always far left with 0 tabs.

I did run with emacs -Q and the same thing happened.

// EXPECTED
public class Thing
{
      public Thing()
      {
          try
          {
              // stuff
          } catch (Exception e)
          {
              // stuff
          }
      }
}

// ACTUAL
public class Thing
{
      public Thing()
{
          try
{
              // stuff
          } catch (Exception e)
{
              // other stuff
          }
     }
}
In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.17.8) of 2023-11-15 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101009
System Description: Gentoo Linux

Configured using:
'configure --prefix=/usr --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --datarootdir=/usr/share
--disable-silent-rules --docdir=/usr/share/doc/emacs-29.1-r5
--htmldir=/usr/share/doc/emacs-29.1-r5/html --libdir=/usr/lib64
--program-suffix=-emacs-29 --includedir=/usr/include/emacs-29
--infodir=/usr/share/info/emacs-29 --localstatedir=/var
--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
--without-compress-install --without-hesiod --without-pop
--with-file-notification=inotify --with-pdumper --enable-acl
--without-dbus --with-modules --without-gameuser --with-libgmp
--without-gpm --with-native-compilation=aot --with-json
--without-kerberos --without-kerberos5 --without-lcms2 --with-xml2
--without-mailutils --without-selinux --without-small-ja-dic
--without-sqlite3 --with-gnutls --without-libsystemd --with-threads
--with-tree-sitter --without-wide-int --with-sound=no --with-zlib
--with-x --without-pgtk --without-ns --without-gconf
--without-gsettings --without-toolkit-scroll-bars --with-xpm --with-xft
--with-cairo --with-harfbuzz --without-libotf --without-m17n-flt
--with-x-toolkit=lucid --with-xaw3d --with-gif --with-jpeg --with-png
--with-rsvg --without-tiff --without-webp --with-imagemagick
--with-dumping=pdumper 'CFLAGS=-O2 -march=native -pipe'
'LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed''

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ IMAGEMAGICK JPEG JSON
LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
THREADS TREE_SITTER X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB

Important settings:
value of $LANG: en_US.utf8
locale-coding-system: utf-8-unix

Major mode: Outline

Minor modes in effect:
goto-address-mode: t
flyspell-mode: t
shell-dirtrack-mode: t
server-mode: t
rainbow-mode: t
yas-global-mode: t
yas-minor-mode: t
global-ligature-mode: t
ligature-mode: t
marginalia-mode: t
vertico-mode: t
which-key-mode: t
delete-selection-mode: t
recentf-mode: t
global-paren-face-mode: t
global-hungry-delete-mode: t
hungry-delete-mode: t
minibuffer-depth-indicate-mode: t
electric-pair-mode: t
global-hl-line-mode: t
whitespace-mode: t
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
global-prettify-symbols-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
buffer-read-only: t
column-number-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
view-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug goto-addr flyspell ispell noutline
outline view jka-compr find-func shortdoc cc-langs cl-print ibuffer
ibuffer-loaddefs help-fns radix-tree java-ts-mode cc-mode-expansions
cc-mode cc-fonts cc-guess cc-menus cc-cmds expand-region
text-mode-expansions er-basic-expansions expand-region-core
expand-region-custom sh-script smie executable files-x compile misearch
multi-isearch smart-tabs-mode advice display-line-numbers elpaca-log
elpaca-ui macros mule-util c-ts-mode c-ts-common treesit edmacro kmacro
eat term ehelp shell pcomplete comint ansi-osc dired-aux vc-git
diff-mode vc-dispatcher parse-time iso8601 server company-oddmuse
company-keywords company-etags etags fileloop xref project ring
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb company rainbow-mode ansi-color color
disp-table pcase yasnippet ligature marginalia vertico which-key
elfeed-show elfeed-search message sendmail yank-media 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 shr pixel-fill
kinsoku puny svg dom elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db
elfeed-lib time-date avl-tree generator url-queue url-file browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap xml-query xml
yasnippet-autoloads company-autoloads tuareg-autoloads caml-autoloads
geiser-chicken-autoloads geiser-autoloads haskell-mode-autoloads
ligature-autoloads smart-tabs-mode-autoloads consult-autoloads
marginalia-autoloads vertico-autoloads which-key-autoloads
elfeed-autoloads diminish bookmark text-property-search pp time delsel
dashboard dashboard-widgets recentf tree-widget wid-edit ffap thingatpt
url-parse auth-source eieio eieio-core password-cache json map byte-opt
url-vars paren-face compat hungry-delete dashboard-autoloads
paren-face-autoloads rainbow-mode-autoloads expand-region-autoloads
magit-section-autoloads git-commit-autoloads with-editor-autoloads
magit-autoloads dash-autoloads hungry-delete-autoloads eat-autoloads
compat-autoloads ef-cherie-theme ef-themes diminish-autoloads
ef-themes-autoloads mb-depth elec-pair cc-styles cc-align cc-engine
cc-vars cc-defs hl-line comp comp-cstr warnings icons subr-x rx cl-extra
help-mode bytecomp byte-compile whitespace dired dired-loaddefs bind-key
easy-mmode cl-seq cl-macs gv elpaca elpaca-process cl-loaddefs cl-lib
elpaca-autoloads site-gentoo 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 inotify dynamic-setting
font-render-setting cairo x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 696666 66035)
(symbols 48 30314 3)
(strings 32 243685 4935)
(string-bytes 1 6134869)
(vectors 16 59205)
(vector-slots 8 1611748 182263)
(floats 8 2492 2500)
(intervals 56 18212 16)
(buffers 984 30))