1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Indent jsx_text properly with modern grammars

* lisp/progmodes/js.el:
* lisp/progmodes/typescript-ts-mode.el: Indent jsx_text from correct
column when a modern grammar is installed; previously was over-indented.
This commit is contained in:
Jackson Ray Hamilton 2025-11-14 22:27:34 -08:00
parent 1c87be8ac9
commit 9b3eb06c76
No known key found for this signature in database
GPG key ID: B4771664B476B290
2 changed files with 2 additions and 2 deletions

View file

@ -3448,7 +3448,7 @@ Check if a node type is available, then return the right indent rules."
((parent-is "jsx_fragment") parent js-indent-level)))
(error
`(((match "<" "jsx_text") parent 0)
((parent-is "jsx_text") parent js-indent-level)))))
((parent-is "jsx_text") parent-bol js-indent-level)))))
(defvar js--treesit-indent-rules
(let ((switch-case (rx "switch_" (or "case" "default"))))

View file

@ -93,7 +93,7 @@ Check if a node type is available, then return the right indent rules."
((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset)))
(treesit-query-error
`(((match "<" "jsx_text") parent 0)
((parent-is "jsx_text") parent typescript-ts-mode-indent-offset)))))
((parent-is "jsx_text") parent-bol typescript-ts-mode-indent-offset)))))
(defun typescript-ts-mode--anchor-decl (_n parent &rest _)
"Return the position after the declaration keyword before PARENT.