* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly @ 2023-01-23 4:33 Aaron Jensen 2023-01-23 21:28 ` Dmitry Gutov 0 siblings, 1 reply; 8+ messages in thread From: Aaron Jensen @ 2023-01-23 4:33 UTC (permalink / raw) To: 61017 Start with a buffer in ruby-ts-mode like: a b Between the two lines, type "class Foo", then press enter You should get this: a class Foo b But this is expected: a class Foo b Note that reindenting after adding the "end" will indent correctly, so it's only an issue with electric indent In GNU Emacs 29.0.60 (build 1, aarch64-apple-darwin22.2.0, NS appkit-2299.30 Version 13.1 (Build 22C65)) of 2023-01-22 built on Aarons-Laptop.local Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.1 Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/info/emacs --prefix=/opt/homebrew/Cellar/emacs-plus@29/29.0.60 --with-xml2 --with-gnutls --with-native-compilation --without-compress-install --without-dbus --without-imagemagick --with-modules --with-rsvg --with-ns --disable-ns-self-contained 'CFLAGS=-Os -w -pipe -mmacosx-version-min=13 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' 'CPPFLAGS=-I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/jpeg/include -I/opt/homebrew/opt/icu4c/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/readline/include -isystem/opt/homebrew/include -F/opt/homebrew/Frameworks -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk' 'LDFLAGS=-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/jpeg/lib -L/opt/homebrew/opt/icu4c/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/lib -F/opt/homebrew/Frameworks -Wl,-headerpad_max_install_names -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'' Configured features: ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Ruby Minor modes in effect: xterm-mouse-mode: t treemacs-filewatch-mode: t treemacs-follow-mode: t treemacs-git-mode: t treemacs-fringe-indicator-mode: t global-evil-mc-mode: t evil-mc-mode: t global-git-commit-mode: t transient-posframe-mode: t evil-ruby-text-objects-mode: t ruby-refactor-mode: t pixel-scroll-precision-mode: t corfu-prescient-mode: t corfu-history-mode: t corfu-mode: t eval-sexp-fu-flash-mode: t eros-mode: t speed-of-thought-mode: t envrc-mode: t global-evil-surround-mode: t evil-surround-mode: t evil-matchit-mode: t evil-vimish-fold-mode: t vimish-fold-mode: t ns-auto-titlebar-mode: t org-roam-db-autosync-mode: t delete-selection-mode: t dtrt-indent-mode: t electric-pair-mode: t global-flycheck-mode: t flycheck-mode: t global-auto-revert-mode: t global-anzu-mode: t anzu-mode: t which-key-posframe-mode: t which-key-mode: t gcmh-mode: t undo-fu-session-global-mode: t undo-fu-session-mode: t ws-butler-global-mode: t ws-butler-mode: t vertico-prescient-mode: t prescient-persist-mode: t vertico-mouse-mode: t vertico-mode: t save-place-mode: t tabspaces-mode: t winner-mode: t savehist-mode: t yas-global-mode: t yas-minor-mode: t mini-frame-mode: t recentf-mode: t better-jumper-mode: t better-jumper-local-mode: t repeat-mode: t server-mode: t +popup-mode: t shell-dirtrack-mode: t evil-mode: t evil-local-mode: t windmove-mode: t nano-modeline-mode: t override-global-mode: t leader-key-leader-override-mode: t global-leader-key-leader-override-mode: t straight-use-package-mode: t straight-package-neutering-mode: t global-display-line-numbers-mode: t display-line-numbers-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 window-divider-mode: t line-number-mode: t auto-fill-function: yas--auto-fill transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /Users/aaronjensen/.emacs.d/straight/build/ivy/elpa hides /Users/aaronjensen/.emacs.d/straight/build/lispy/elpa /Users/aaronjensen/.emacs.d/straight/build/transient/transient hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/transient /Users/aaronjensen/.emacs.d/straight/build/org/ob-comint hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-comint /Users/aaronjensen/.emacs.d/straight/build/org/ob-exp hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-exp /Users/aaronjensen/.emacs.d/straight/build/org/org-ctags hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-ctags /Users/aaronjensen/.emacs.d/straight/build/org/ob-emacs-lisp hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-emacs-lisp /Users/aaronjensen/.emacs.d/straight/build/org/oc hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/oc /Users/aaronjensen/.emacs.d/straight/build/org/ox-texinfo hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-texinfo /Users/aaronjensen/.emacs.d/straight/build/org/ol-irc hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-irc /Users/aaronjensen/.emacs.d/straight/build/org/ol-doi hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-doi /Users/aaronjensen/.emacs.d/straight/build/org/ob hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob /Users/aaronjensen/.emacs.d/straight/build/org/org-refile hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-refile /Users/aaronjensen/.emacs.d/straight/build/org/org-version hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-version /Users/aaronjensen/.emacs.d/straight/build/org/org-num hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-num /Users/aaronjensen/.emacs.d/straight/build/org/ol-mhe hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-mhe /Users/aaronjensen/.emacs.d/straight/build/org/ob-shell hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-shell /Users/aaronjensen/.emacs.d/straight/build/org/org-attach hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-attach /Users/aaronjensen/.emacs.d/straight/build/org/ob-C hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-C /Users/aaronjensen/.emacs.d/straight/build/org/org-macs hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-macs /Users/aaronjensen/.emacs.d/straight/build/org/org-entities hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-entities /Users/aaronjensen/.emacs.d/straight/build/org/ob-dot hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-dot /Users/aaronjensen/.emacs.d/straight/build/org/ob-sql hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-sql /Users/aaronjensen/.emacs.d/straight/build/org/ol-eww hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-eww /Users/aaronjensen/.emacs.d/straight/build/org/org-datetree hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-datetree /Users/aaronjensen/.emacs.d/straight/build/org/org-macro hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-macro /Users/aaronjensen/.emacs.d/straight/build/org/ob-eval hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-eval /Users/aaronjensen/.emacs.d/straight/build/org/ob-haskell hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-haskell /Users/aaronjensen/.emacs.d/straight/build/org/ox-org hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-org /Users/aaronjensen/.emacs.d/straight/build/org/ol-rmail hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-rmail /Users/aaronjensen/.emacs.d/straight/build/org/ob-awk hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-awk /Users/aaronjensen/.emacs.d/straight/build/org/ob-groovy hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-groovy /Users/aaronjensen/.emacs.d/straight/build/org/ox-icalendar hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-icalendar /Users/aaronjensen/.emacs.d/straight/build/org/ob-octave hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-octave /Users/aaronjensen/.emacs.d/straight/build/org/ob-scheme hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-scheme /Users/aaronjensen/.emacs.d/straight/build/org/org-mobile hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-mobile /Users/aaronjensen/.emacs.d/straight/build/org/ob-processing hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-processing /Users/aaronjensen/.emacs.d/straight/build/org/oc-biblatex hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/oc-biblatex /Users/aaronjensen/.emacs.d/straight/build/org/oc-csl hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/oc-csl /Users/aaronjensen/.emacs.d/straight/build/org/org-colview hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-colview /Users/aaronjensen/.emacs.d/straight/build/org/ob-R hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-R /Users/aaronjensen/.emacs.d/straight/build/org/org-table hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-table /Users/aaronjensen/.emacs.d/straight/build/org/ox-html hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-html /Users/aaronjensen/.emacs.d/straight/build/org/ob-fortran hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-fortran /Users/aaronjensen/.emacs.d/straight/build/org/ol hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol /Users/aaronjensen/.emacs.d/straight/build/org/ob-plantuml hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-plantuml /Users/aaronjensen/.emacs.d/straight/build/org/ol-docview hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-docview /Users/aaronjensen/.emacs.d/straight/build/org/ob-perl hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-perl /Users/aaronjensen/.emacs.d/straight/build/org/ob-sqlite hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-sqlite /Users/aaronjensen/.emacs.d/straight/build/org/oc-basic hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/oc-basic /Users/aaronjensen/.emacs.d/straight/build/org/ob-sed hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-sed /Users/aaronjensen/.emacs.d/straight/build/org/org-fold-core hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-fold-core /Users/aaronjensen/.emacs.d/straight/build/org/ob-ditaa hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-ditaa /Users/aaronjensen/.emacs.d/straight/build/org/ob-ruby hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-ruby /Users/aaronjensen/.emacs.d/straight/build/org/oc-bibtex hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/oc-bibtex /Users/aaronjensen/.emacs.d/straight/build/org/org-habit hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-habit /Users/aaronjensen/.emacs.d/straight/build/org/org-loaddefs hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-loaddefs /Users/aaronjensen/.emacs.d/straight/build/org/ol-gnus hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-gnus /Users/aaronjensen/.emacs.d/straight/build/org/ob-screen hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-screen /Users/aaronjensen/.emacs.d/straight/build/org/org-mouse hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-mouse /Users/aaronjensen/.emacs.d/straight/build/org/ob-css hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-css /Users/aaronjensen/.emacs.d/straight/build/org/org-inlinetask hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-inlinetask /Users/aaronjensen/.emacs.d/straight/build/org/ob-lisp hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-lisp /Users/aaronjensen/.emacs.d/straight/build/org/ol-eshell hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-eshell /Users/aaronjensen/.emacs.d/straight/build/org/org-pcomplete hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-pcomplete /Users/aaronjensen/.emacs.d/straight/build/org/org-lint hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-lint /Users/aaronjensen/.emacs.d/straight/build/org/org-id hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-id /Users/aaronjensen/.emacs.d/straight/build/org/org-capture hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-capture /Users/aaronjensen/.emacs.d/straight/build/org/ob-sass hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-sass /Users/aaronjensen/.emacs.d/straight/build/org/ob-tangle hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-tangle /Users/aaronjensen/.emacs.d/straight/build/org/ob-calc hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-calc /Users/aaronjensen/.emacs.d/straight/build/org/ob-java hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-java /Users/aaronjensen/.emacs.d/straight/build/org/org-compat hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-compat /Users/aaronjensen/.emacs.d/straight/build/org/org-attach-git hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-attach-git /Users/aaronjensen/.emacs.d/straight/build/org/ox-beamer hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-beamer /Users/aaronjensen/.emacs.d/straight/build/org/org-protocol hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-protocol /Users/aaronjensen/.emacs.d/straight/build/org/org-element hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-element /Users/aaronjensen/.emacs.d/straight/build/org/ob-lob hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-lob /Users/aaronjensen/.emacs.d/straight/build/org/org-tempo hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-tempo /Users/aaronjensen/.emacs.d/straight/build/org/ob-python hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-python /Users/aaronjensen/.emacs.d/straight/build/org/ob-latex hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-latex /Users/aaronjensen/.emacs.d/straight/build/org/ol-w3m hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-w3m /Users/aaronjensen/.emacs.d/straight/build/org/org-agenda hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-agenda /Users/aaronjensen/.emacs.d/straight/build/org/org-persist hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-persist /Users/aaronjensen/.emacs.d/straight/build/org/ob-ocaml hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-ocaml /Users/aaronjensen/.emacs.d/straight/build/org/ob-ref hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-ref /Users/aaronjensen/.emacs.d/straight/build/org/org-fold hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-fold /Users/aaronjensen/.emacs.d/straight/build/org/ob-julia hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-julia /Users/aaronjensen/.emacs.d/straight/build/org/ob-lilypond hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-lilypond /Users/aaronjensen/.emacs.d/straight/build/org/ob-table hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-table /Users/aaronjensen/.emacs.d/straight/build/org/ob-clojure hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-clojure /Users/aaronjensen/.emacs.d/straight/build/org/org-indent hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-indent /Users/aaronjensen/.emacs.d/straight/build/org/org-plot hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-plot /Users/aaronjensen/.emacs.d/straight/build/org/ox-latex hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-latex /Users/aaronjensen/.emacs.d/straight/build/org/org-src hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-src /Users/aaronjensen/.emacs.d/straight/build/org/org-duration hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-duration /Users/aaronjensen/.emacs.d/straight/build/org/ob-makefile hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-makefile /Users/aaronjensen/.emacs.d/straight/build/org/ol-info hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-info /Users/aaronjensen/.emacs.d/straight/build/org/org-clock hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-clock /Users/aaronjensen/.emacs.d/straight/build/org/ob-forth hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-forth /Users/aaronjensen/.emacs.d/straight/build/org/ox-odt hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-odt /Users/aaronjensen/.emacs.d/straight/build/org/ol-man hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-man /Users/aaronjensen/.emacs.d/straight/build/org/ox-publish hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-publish /Users/aaronjensen/.emacs.d/straight/build/org/org-archive hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-archive /Users/aaronjensen/.emacs.d/straight/build/org/ob-org hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-org /Users/aaronjensen/.emacs.d/straight/build/org/ob-lua hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-lua /Users/aaronjensen/.emacs.d/straight/build/org/org-keys hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-keys /Users/aaronjensen/.emacs.d/straight/build/org/ob-eshell hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-eshell /Users/aaronjensen/.emacs.d/straight/build/org/org-faces hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-faces /Users/aaronjensen/.emacs.d/straight/build/org/ox-man hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-man /Users/aaronjensen/.emacs.d/straight/build/org/org-list hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-list /Users/aaronjensen/.emacs.d/straight/build/org/ox-md hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-md /Users/aaronjensen/.emacs.d/straight/build/org/org-goto hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-goto /Users/aaronjensen/.emacs.d/straight/build/org/ol-bbdb hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-bbdb /Users/aaronjensen/.emacs.d/straight/build/org/org hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org /Users/aaronjensen/.emacs.d/straight/build/org/ol-bibtex hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ol-bibtex /Users/aaronjensen/.emacs.d/straight/build/org/ox-koma-letter hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-koma-letter /Users/aaronjensen/.emacs.d/straight/build/org/ox-ascii hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox-ascii /Users/aaronjensen/.emacs.d/straight/build/org/ob-matlab hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-matlab /Users/aaronjensen/.emacs.d/straight/build/org/ox hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ox /Users/aaronjensen/.emacs.d/straight/build/org/org-timer hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-timer /Users/aaronjensen/.emacs.d/straight/build/org/oc-natbib hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/oc-natbib /Users/aaronjensen/.emacs.d/straight/build/org/ob-core hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-core /Users/aaronjensen/.emacs.d/straight/build/org/org-feed hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-feed /Users/aaronjensen/.emacs.d/straight/build/org/ob-gnuplot hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-gnuplot /Users/aaronjensen/.emacs.d/straight/build/org/ob-js hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-js /Users/aaronjensen/.emacs.d/straight/build/org/org-footnote hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-footnote /Users/aaronjensen/.emacs.d/straight/build/org/ob-maxima hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/ob-maxima /Users/aaronjensen/.emacs.d/straight/build/org/org-cycle hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-cycle /Users/aaronjensen/.emacs.d/straight/build/org/org-crypt hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/org/org-crypt /Users/aaronjensen/.emacs.d/straight/build/let-alist/let-alist hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/emacs-lisp/let-alist /Users/aaronjensen/.emacs.d/straight/build/eldoc/eldoc hides /opt/homebrew/Cellar/emacs-plus@29/29.0.60/share/emacs/29.0.60/lisp/emacs-lisp/eldoc Features: (shadow sort mail-extr emacsbug magit-gitignore evil-collection-dired xt-mouse consult-git-commit evil-matchit-html evil-matchit-javascript rotate find-dired evil-numbers speeddating evil-collection-arc-mode arc-mode archive-mode hippie-exp misearch multi-isearch rfc2104 tramp-cache time-stamp tramp-sh terraform-mode hcl-mode haml-mode css-mode emmet-mode cl web-mode titlecase titlecase-data drag-stuff align yaml-mode descr-text evil-little-word imenu-list hideshow goto-chg semantic/db-file data-debug cedet-files semantic/bovine/el semantic/db-el eieio-opt speedbar dframe semantic/bovine ruby-ts-mode git-rebase evil-collection-vundo vundo typescript-ts-mode lsp-diagnostics lsp-modeline lsp-lens lsp-ui lsp-ui-flycheck lsp-ui-doc lsp-ui-imenu lsp-ui-peek lsp-ui-sideline lsp-ui-util image-file image-converter org-drill persist vertico-repeat consult-xref dumb-jump popup semantic/ia semantic/analyze/refs semantic/db-find semantic/db-ref semantic/senator semantic/decorate semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/db eieio-base semantic/ctxt semantic/format ezimage semantic/tag-ls semantic/find semantic/util-modes semantic/util semantic semantic/tag cedet copy-as-format epa-file tramp-cmds novice dired-subtree dired-hacks-utils evil-nerd-commenter evil-nerd-commenter-operator evil-nerd-commenter-sdk conf-mode dabbrev ripgrep-capf evil-matchit-ruby evil-matchit-simple evil-matchit-prog evil-matchit evil-matchit-sdk semantic/lex semantic/fw tab-line evil-collection-vterm vterm tramp tramp-loaddefs trampver tramp-integration tramp-compat ls-lisp term ehelp vterm-module term/xterm xterm org-clock wgrep grep embark-org embark-consult embark ffap cal-move make-mode magit-patch cus-start goto-addr json-mode json-snatcher lsp-zig lsp-steep lsp-svelte lsp-sqls lsp-ruby-syntax-tree lsp-yaml lsp-xml lsp-vimscript lsp-vhdl lsp-volar lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v lsp-typeprof lsp-ttcn3 lsp-toml lsp-terraform lsp-tex lsp-sorbet lsp-solargraph lsp-rust lsp-rf lsp-remark lsp-racket lsp-r lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh lsp-php lsp-pls lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml lsp-magik lsp-nix lsp-nim lsp-nginx lsp-mint lsp-marksman lsp-markdown lsp-lua lsp-kotlin lsp-json lsp-javascript lsp-idris lsp-haxe lsp-groovy lsp-hack lsp-graphql lsp-gleam lsp-go lsp-completion lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elixir lsp-elm lsp-dockerfile lsp-dhall lsp-d lsp-css lsp-csharp lsp-crystal lsp-cmake lsp-clojure lsp-semantic-tokens lsp-clangd lsp-beancount lsp-bash lsp-astro lsp-ansible lsp-angular lsp-ada lsp-actionscript lsp-mode lsp-protocol spinner network-stream js c-ts-mode c-ts-common cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine sql view diary-lib diary-loaddefs magit-extras vc-hg vc-bzr vc-src vc-sccs vc-cvs vc-rcs log-view bug-reference evil-collection-helpful helpful cc-langs cc-vars cc-defs trace info-look elisp-refs sh-script treesit rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid nxml-mode nxml-outln nxml-rap sgml-mode facemenu consult-vertico consult treemacs-bookmarks treemacs-tags magit-bookmark bookmark lua-mode executable treemacs-magit treemacs-evil doom-themes-ext-treemacs doom-themes doom-themes-base treemacs-tab-bar treemacs-all-the-icons all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons treemacs treemacs-header-line treemacs-compatibility treemacs-mode treemacs-interface treemacs-persistence treemacs-filewatch-mode treemacs-follow-mode treemacs-rendering treemacs-annotations treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals treemacs-fringe-indicator treemacs-scope pulse treemacs-faces treemacs-icons treemacs-themes dired-aux treemacs-core-utils pfuture inline ht treemacs-logging treemacs-customization treemacs-macros hl-line evil-collection-ibuffer ibuffer ibuffer-loaddefs org-journal org-crypt cal-iso magit-delta xterm-color evil-mc evil-mc-command-execute evil-mc-command-record evil-mc-cursor-make evil-mc-region evil-mc-cursor-state evil-mc-undo evil-mc-vars shortdoc evil-collection-magit 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 package url-handlers magit-repos magit-apply magit-wip magit-log which-func magit-diff smerge-mode diff git-commit log-edit pcvs-util add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor magit-mode transient-posframe transient magit-git evil-ruby-text-objects ruby-refactor bundler inf-ruby ruby-mode smie compile magit-base crm cl-print tabify pixel-scroll cua-base cape corfu-prescient corfu-history corfu eval-sexp-fu eros lispyville lispy lispy-inline avy etags fileloop evil-collection-edebug edebug help-fns radix-tree lispy-tags mode-local zoutline elisp-def ert ewoc evil-collection-debug debug backtrace evil-collection-xref xref sotlisp skeleton envrc inheritenv evil-surround evil-matchit-evil-setup evil-vimish-fold vimish-fold f f-shortdoc vc-git diff-mode flyspell ispell org-appear orgonomic org-indent org-superstar oc-basic ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime ns-auto-titlebar gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom browse-url gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range message sendmail yank-media rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util text-property-search mail-utils range ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi imenu ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda ox-ascii ox-gfm ox-md ox-html table ox-publish ox org-download url-http url url-proxy url-privacy url-expand url-methods url-history mailcap url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-cookie generate-lisp-file url-domsuf url-util url-gw nsm puny async vulpea vulpea-meta vulpea-select vulpea-buffer vulpea-db s vulpea-utils vulpea-note 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-mac-link org-goto org-capture org-attach emacsql-sqlite emacsql emacsql-compiler magit-section org-tempo tempo evil-org-agenda evil-org org-element org-persist xdg org-id org-refile avl-tree generator ob-shell org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities time-date ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs cal-menu calendar cal-loaddefs org-version delsel org-compat org-macs format-spec form-feed popup-mode-core dtrt-indent elec-pair evil-terminal-cursor-changer popup-mode-hacks flycheck find-func dash autorevert filenotify evil-anzu anzu which-key-posframe posframe evil-collection-which-key which-key markdown-mode url-parse auth-source eieio eieio-core password-cache json map url-vars noutline outline color gcmh undo-fu-session ws-butler vertico-directory vertico-prescient prescient char-fold vertico-mouse vertico evil-mc-known-commands evil-mc-common cursor-sensor hide-mode-line saveplace tabspaces dired-x dired dired-loaddefs vc vc-dispatcher winner savehist yasnippet mini-frame recentf tree-widget better-jumper repeat vc-svn project server gcmh-autoloads copy-as-format-autoloads pdf-tools-autoloads tablist-autoloads restclient-autoloads vterm-autoloads dumb-jump-autoloads popup-autoloads haml-mode-autoloads emmet-mode-autoloads terraform-mode-autoloads hcl-mode-autoloads dockerfile-mode-autoloads yaml-mode-autoloads json-snatcher-autoloads lua-mode-autoloads bundler-autoloads inf-ruby-autoloads ruby-refactor-autoloads evil-ruby-text-objects-autoloads sotlisp-autoloads elisp-def-autoloads lispyville-autoloads lispy-autoloads zoutline-autoloads swiper-autoloads ivy-autoloads iedit-autoloads eros-autoloads eval-sexp-fu-autoloads web-mode-autoloads ripgrep-capf-autoloads git-link-autoloads consult-git-commit-autoloads git-timemachine-autoloads magit-delta-autoloads xterm-color-autoloads prettier-autoloads editorconfig-autoloads nvm-autoloads iter2-autoloads flycheck-autoloads let-alist-autoloads pkg-info-autoloads epl-autoloads lsp-ui-autoloads lsp-mode-autoloads eldoc-autoloads markdown-mode-autoloads spinner-autoloads imenu-list-autoloads org-superstar-autoloads ox-gfm-autoloads org-pandoc-import-autoloads gnuplot-autoloads org-download-autoloads async-autoloads org-journal-autoloads deft-autoloads vulpea-autoloads org-roam-autoloads emacsql-sqlite-autoloads emacsql-autoloads orgonomic-autoloads org-drill-autoloads persist-autoloads org-appear-autoloads org-mac-link-autoloads evil-org-autoloads evil-terminal-cursor-changer-autoloads transient-posframe-autoloads better-jumper-autoloads hydra lv buffer-move-autoloads rotate-autoloads mini-frame-autoloads embark-consult-autoloads embark-autoloads consult-autoloads orderless orderless-autoloads cape-autoloads corfu-prescient-autoloads corfu-autoloads vertico-prescient-autoloads vertico-autoloads prescient-autoloads tabspaces-autoloads which-key-posframe-autoloads which-key-autoloads popup-mode popup-mode-settings popup-mode-autoloads hide-mode-line-autoloads evil-anzu-autoloads anzu-autoloads titlecase-autoloads wgrep-autoloads yasnippet-autoloads form-feed-autoloads drag-stuff-autoloads dtrt-indent-autoloads ws-butler-autoloads evil-vimish-fold-autoloads vimish-fold-autoloads evil-collection annalist evil-collection-autoloads annalist-autoloads evil-mc-autoloads evil-numbers-autoloads speeddating-autoloads evil-little-word-autoloads evil-matchit-autoloads evil-nerd-commenter-autoloads evil-visualstar-autoloads evil-surround-autoloads pcase cus-edit cus-load wid-edit evil evil-integration evil-maps evil-commands reveal evil-jumps evil-command-window evil-search evil-ex shell pcomplete comint ansi-osc ansi-color evil-types evil-macros evil-repeat evil-states evil-core byte-opt advice evil-common windmove calc calc-loaddefs calc-macs thingatpt rect evil-digraphs evil-vars pp vundo-autoloads undo-fu-session-autoloads ztree-autoloads dwim-shell-command-autoloads doom-themes-autoloads treemacs-tab-bar-autoloads treemacs-magit-autoloads magit-autoloads magit-section-autoloads git-commit-autoloads with-editor-autoloads transient-autoloads treemacs-all-the-icons-autoloads all-the-icons-autoloads treemacs-evil-autoloads evil-autoloads goto-chg-autoloads treemacs-autoloads cfrs-autoloads ht-autoloads pfuture-autoloads ace-window-autoloads avy-autoloads rainbow-mode-autoloads posframe-autoloads ns-auto-titlebar-autoloads nano-modeline memoize nano-modeline-autoloads memoize-autoloads nano-light-theme face-remap nano-theme disp-table nano-theme-autoloads envrc-autoloads inheritenv-autoloads compdef derived compdef-autoloads ring helpful-autoloads elisp-refs-autoloads f-autoloads s-autoloads edmacro kmacro dired-subtree-autoloads dired-hacks-utils-autoloads dash-autoloads use-package-bind-key bind-key easy-mmode hydra-autoloads lv-autoloads finder-inf leader-key bind-map leader-key-autoloads bind-map-autoloads no-littering compat no-littering-autoloads compat-autoloads use-package-core info files-x straight-autoloads straight comp comp-cstr warnings subr-x rx cl-seq cl-macs gv bytecomp byte-compile cl-extra help-mode icons cl-loaddefs cl-lib display-line-numbers 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 native-compile emacs) Memory information: ((conses 16 3446155 1150991) (symbols 48 80600 253) (strings 32 386755 236407) (string-bytes 1 12445053) (vectors 16 294355) (vector-slots 8 5369625 1855516) (floats 8 4074 7911) (intervals 56 141005 6285) (buffers 984 272)) ^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly 2023-01-23 4:33 bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly Aaron Jensen @ 2023-01-23 21:28 ` Dmitry Gutov 2023-01-24 14:17 ` Aaron Jensen 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Gutov @ 2023-01-23 21:28 UTC (permalink / raw) To: Aaron Jensen, 61017 [-- Attachment #1: Type: text/plain, Size: 885 bytes --] Hi! On 23/01/2023 06:33, Aaron Jensen wrote: > > Start with a buffer in ruby-ts-mode like: > > a > > b > > Between the two lines, type "class Foo", then press enter > > You should get this: > > a > > class Foo > > b > > But this is expected: > > a > > class Foo > > b > > Note that reindenting after adding the "end" will indent correctly, so > it's only an issue with electric indent Thanks for the report, the problem here is that such examples parse into a malformed syntax tree: (program (identifier) (ERROR class (constant) (identifier))) Another example would be: class C def foo which parses as (ERROR class (constant) def (identifier)) We can try to anticipate such cases and infer the implied structure somehow, or just disable indentation for specific cases. See the attached patch for the latter. Is it enough of an improvement? [-- Attachment #2: ruby-ts-error-indent.diff --] [-- Type: text/x-patch, Size: 696 bytes --] diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index f0337775d51..c3c77d68e9a 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -546,6 +546,12 @@ ruby-ts--indent-rules ((n-p-gp nil nil "regex") no-indent 0) ((parent-is "regex") no-indent 0) + ;; Incomplete buffer state, better not reindent. + ((and (parent-is "ERROR") + (or (node-is ,ruby-ts--class-or-module-regex) + (node-is "\\`def\\'"))) + no-indent 0) + ;; if then else elseif notes: ;; ;; 1. The "then" starts at the end of the line that ends ^ permalink raw reply related [flat|nested] 8+ messages in thread
* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly 2023-01-23 21:28 ` Dmitry Gutov @ 2023-01-24 14:17 ` Aaron Jensen 2023-01-24 18:53 ` Dmitry Gutov 0 siblings, 1 reply; 8+ messages in thread From: Aaron Jensen @ 2023-01-24 14:17 UTC (permalink / raw) To: Dmitry Gutov; +Cc: 61017 On Mon, Jan 23, 2023 at 4:28 PM Dmitry Gutov <dgutov@yandex.ru> wrote: > > Hi! > > On 23/01/2023 06:33, Aaron Jensen wrote: > > > > Start with a buffer in ruby-ts-mode like: > > > > a > > > > b > > > > Between the two lines, type "class Foo", then press enter > > > > You should get this: > > > > a > > > > class Foo > > > > b > > > > But this is expected: > > > > a > > > > class Foo > > > > b > > > > Note that reindenting after adding the "end" will indent correctly, so > > it's only an issue with electric indent > > Thanks for the report, the problem here is that such examples parse into > a malformed syntax tree: > > (program (identifier) > (ERROR class (constant) (identifier))) > > Another example would be: > > class C > def foo > > which parses as > > (ERROR class (constant) def (identifier)) > > We can try to anticipate such cases and infer the implied structure > somehow, or just disable indentation for specific cases. See the > attached patch for the latter. > > Is it enough of an improvement? That seems to make indentation after an open def not happen: def foo bar end I applied the patch manually though, so maybe you can confirm that you see the same thing? ^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly 2023-01-24 14:17 ` Aaron Jensen @ 2023-01-24 18:53 ` Dmitry Gutov 2023-01-25 0:45 ` Aaron Jensen 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Gutov @ 2023-01-24 18:53 UTC (permalink / raw) To: Aaron Jensen; +Cc: 61017 On 24/01/2023 16:17, Aaron Jensen wrote: > On Mon, Jan 23, 2023 at 4:28 PM Dmitry Gutov <dgutov@yandex.ru> wrote: >> >> Hi! >> >> On 23/01/2023 06:33, Aaron Jensen wrote: >>> >>> Start with a buffer in ruby-ts-mode like: >>> >>> a >>> >>> b >>> >>> Between the two lines, type "class Foo", then press enter >>> >>> You should get this: >>> >>> a >>> >>> class Foo >>> >>> b >>> >>> But this is expected: >>> >>> a >>> >>> class Foo >>> >>> b >>> >>> Note that reindenting after adding the "end" will indent correctly, so >>> it's only an issue with electric indent >> >> Thanks for the report, the problem here is that such examples parse into >> a malformed syntax tree: >> >> (program (identifier) >> (ERROR class (constant) (identifier))) >> >> Another example would be: >> >> class C >> def foo >> >> which parses as >> >> (ERROR class (constant) def (identifier)) >> >> We can try to anticipate such cases and infer the implied structure >> somehow, or just disable indentation for specific cases. See the >> attached patch for the latter. >> >> Is it enough of an improvement? > > That seems to make indentation after an open def not happen: > > def foo > bar > end Not sure what you mean. Is that an example with an "open def"? "end" seems to be closing it. In the final state, it indents correctly here. > I applied the patch manually though, so maybe you can confirm that you > see the same thing? If I have a buffer with just the first line: def foo then it indeed doesn't indent. But I think that happens with or without this patch? It's a slightly different problem: the grammar parses this code example without ERROR nodes, like a full method, for some reason: (program (method def body: (identifier) end)) And the end position of the "virtual" end node stays at the previous line, so our code doesn't know it's inside the method. I suppose we could add some tricky predicate like (is the previous node a method with an "end" child that is 0 characters long), but the grammar might change (we should look for any previous reported issues about this behavior, or maybe ones that resulted in it), and it only happen this way when there is nothing after "def xyz" in the buffer. Because in the more common case, like class C def foo | end the last "end" is parsed like the closer for the method, the method node spans until it, and the line with "|" indents correctly. WDYT? ^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly 2023-01-24 18:53 ` Dmitry Gutov @ 2023-01-25 0:45 ` Aaron Jensen 2023-01-25 4:00 ` Dmitry Gutov 0 siblings, 1 reply; 8+ messages in thread From: Aaron Jensen @ 2023-01-25 0:45 UTC (permalink / raw) To: Dmitry Gutov; +Cc: 61017 On Tue, Jan 24, 2023 at 1:53 PM Dmitry Gutov <dgutov@yandex.ru> wrote: > > On 24/01/2023 16:17, Aaron Jensen wrote: > > On Mon, Jan 23, 2023 at 4:28 PM Dmitry Gutov <dgutov@yandex.ru> wrote: > >> > >> Hi! > >> > >> On 23/01/2023 06:33, Aaron Jensen wrote: > >>> > >>> Start with a buffer in ruby-ts-mode like: > >>> > >>> a > >>> > >>> b > >>> > >>> Between the two lines, type "class Foo", then press enter > >>> > >>> You should get this: > >>> > >>> a > >>> > >>> class Foo > >>> > >>> b > >>> > >>> But this is expected: > >>> > >>> a > >>> > >>> class Foo > >>> > >>> b > >>> > >>> Note that reindenting after adding the "end" will indent correctly, so > >>> it's only an issue with electric indent > >> > >> Thanks for the report, the problem here is that such examples parse into > >> a malformed syntax tree: > >> > >> (program (identifier) > >> (ERROR class (constant) (identifier))) > >> > >> Another example would be: > >> > >> class C > >> def foo > >> > >> which parses as > >> > >> (ERROR class (constant) def (identifier)) > >> > >> We can try to anticipate such cases and infer the implied structure > >> somehow, or just disable indentation for specific cases. See the > >> attached patch for the latter. > >> > >> Is it enough of an improvement? > > > > That seems to make indentation after an open def not happen: > > > > def foo > > bar > > end > > Not sure what you mean. Is that an example with an "open def"? "end" > seems to be closing it. In the final state, it indents correctly here. Sorry, that's what I meant. If I do type exactly that and do not reindent, I end up with that though (closing with the end does not cause the previous line to reindent) > > > I applied the patch manually though, so maybe you can confirm that you > > see the same thing? > > If I have a buffer with just the first line: > > def foo > > then it indeed doesn't indent. But I think that happens with or without > this patch? > > It's a slightly different problem: the grammar parses this code example > without ERROR nodes, like a full method, for some reason: > > (program > (method def body: (identifier) end)) > > And the end position of the "virtual" end node stays at the previous > line, so our code doesn't know it's inside the method. > > I suppose we could add some tricky predicate like (is the previous node > a method with an "end" child that is 0 characters long), but the grammar > might change (we should look for any previous reported issues about this > behavior, or maybe ones that resulted in it), and it only happen this > way when there is nothing after "def xyz" in the buffer. I wonder if this is mistaken handling of endless methods? I can't think of a reason that it would parse like that. Should that be reported upstream? > Because in the more common case, like > > class C > def foo > | > end > > the last "end" is parsed like the closer for the method, the method node > spans until it, and the line with "|" indents correctly. > > WDYT? ^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly 2023-01-25 0:45 ` Aaron Jensen @ 2023-01-25 4:00 ` Dmitry Gutov 2023-01-25 14:22 ` Aaron Jensen 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Gutov @ 2023-01-25 4:00 UTC (permalink / raw) To: Aaron Jensen; +Cc: 61017 On 25/01/2023 02:45, Aaron Jensen wrote: >>>> Is it enough of an improvement? >>> >>> That seems to make indentation after an open def not happen: >>> >>> def foo >>> bar >>> end >> >> Not sure what you mean. Is that an example with an "open def"? "end" >> seems to be closing it. In the final state, it indents correctly here. > > Sorry, that's what I meant. If I do type exactly that and do not > reindent, I end up with that though (closing with the end does not > cause the previous line to reindent) All right. But if the proposed patch doesn't make things worse for this example, we might as well install it. Because this "unclosed def" case is distinct from the one you filed this bug report regarding. >>> I applied the patch manually though, so maybe you can confirm that you >>> see the same thing? >> >> If I have a buffer with just the first line: >> >> def foo >> >> then it indeed doesn't indent. But I think that happens with or without >> this patch? >> >> It's a slightly different problem: the grammar parses this code example >> without ERROR nodes, like a full method, for some reason: >> >> (program >> (method def body: (identifier) end)) >> >> And the end position of the "virtual" end node stays at the previous >> line, so our code doesn't know it's inside the method. >> >> I suppose we could add some tricky predicate like (is the previous node >> a method with an "end" child that is 0 characters long), but the grammar >> might change (we should look for any previous reported issues about this >> behavior, or maybe ones that resulted in it), and it only happen this >> way when there is nothing after "def xyz" in the buffer. > > I wonder if this is mistaken handling of endless methods? Those parse to nodes that look a little different (no "end"): (program (method def body: (identifier) = (integer))) So I'm not sure. > I can't > think of a reason that it would parse like that. Should that be > reported upstream? I filed https://github.com/tree-sitter/tree-sitter-ruby/issues/234, let's see if there is any response. ^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly 2023-01-25 4:00 ` Dmitry Gutov @ 2023-01-25 14:22 ` Aaron Jensen 2023-01-25 15:23 ` Dmitry Gutov 0 siblings, 1 reply; 8+ messages in thread From: Aaron Jensen @ 2023-01-25 14:22 UTC (permalink / raw) To: Dmitry Gutov; +Cc: 61017 On Tue, Jan 24, 2023 at 11:00 PM Dmitry Gutov <dgutov@yandex.ru> wrote: > > On 25/01/2023 02:45, Aaron Jensen wrote: > > >>>> Is it enough of an improvement? > >>> > >>> That seems to make indentation after an open def not happen: > >>> > >>> def foo > >>> bar > >>> end > >> > >> Not sure what you mean. Is that an example with an "open def"? "end" > >> seems to be closing it. In the final state, it indents correctly here. > > > > Sorry, that's what I meant. If I do type exactly that and do not > > reindent, I end up with that though (closing with the end does not > > cause the previous line to reindent) > > All right. > > But if the proposed patch doesn't make things worse for this example, we > might as well install it. Because this "unclosed def" case is distinct > from the one you filed this bug report regarding. Sounds good to me. > >>> I applied the patch manually though, so maybe you can confirm that you > >>> see the same thing? > >> > >> If I have a buffer with just the first line: > >> > >> def foo > >> > >> then it indeed doesn't indent. But I think that happens with or without > >> this patch? > >> > >> It's a slightly different problem: the grammar parses this code example > >> without ERROR nodes, like a full method, for some reason: > >> > >> (program > >> (method def body: (identifier) end)) > >> > >> And the end position of the "virtual" end node stays at the previous > >> line, so our code doesn't know it's inside the method. > >> > >> I suppose we could add some tricky predicate like (is the previous node > >> a method with an "end" child that is 0 characters long), but the grammar > >> might change (we should look for any previous reported issues about this > >> behavior, or maybe ones that resulted in it), and it only happen this > >> way when there is nothing after "def xyz" in the buffer. > > > > I wonder if this is mistaken handling of endless methods? > > Those parse to nodes that look a little different (no "end"): > > (program > (method def body: (identifier) = (integer))) > > So I'm not sure. > > > I can't > > think of a reason that it would parse like that. Should that be > > reported upstream? > > I filed https://github.com/tree-sitter/tree-sitter-ruby/issues/234, > let's see if there is any response. Thank you. Aaron ^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly 2023-01-25 14:22 ` Aaron Jensen @ 2023-01-25 15:23 ` Dmitry Gutov 0 siblings, 0 replies; 8+ messages in thread From: Dmitry Gutov @ 2023-01-25 15:23 UTC (permalink / raw) To: Aaron Jensen; +Cc: 61017-done On 25/01/2023 16:22, Aaron Jensen wrote: > On Tue, Jan 24, 2023 at 11:00 PM Dmitry Gutov<dgutov@yandex.ru> wrote: >> On 25/01/2023 02:45, Aaron Jensen wrote: >> >>>>>> Is it enough of an improvement? >>>>> That seems to make indentation after an open def not happen: >>>>> >>>>> def foo >>>>> bar >>>>> end >>>> Not sure what you mean. Is that an example with an "open def"? "end" >>>> seems to be closing it. In the final state, it indents correctly here. >>> Sorry, that's what I meant. If I do type exactly that and do not >>> reindent, I end up with that though (closing with the end does not >>> cause the previous line to reindent) >> All right. >> >> But if the proposed patch doesn't make things worse for this example, we >> might as well install it. Because this "unclosed def" case is distinct >> from the one you filed this bug report regarding. > Sounds good to me. And done. Thanks for testing. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-01-25 15:23 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-01-23 4:33 bug#61017: 29.0.60; ruby-ts-mode indents class between two lines incorrectly Aaron Jensen 2023-01-23 21:28 ` Dmitry Gutov 2023-01-24 14:17 ` Aaron Jensen 2023-01-24 18:53 ` Dmitry Gutov 2023-01-25 0:45 ` Aaron Jensen 2023-01-25 4:00 ` Dmitry Gutov 2023-01-25 14:22 ` Aaron Jensen 2023-01-25 15:23 ` Dmitry Gutov
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).