mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -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:
parent
1c87be8ac9
commit
9b3eb06c76
2 changed files with 2 additions and 2 deletions
|
|
@ -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)))
|
((parent-is "jsx_fragment") parent js-indent-level)))
|
||||||
(error
|
(error
|
||||||
`(((match "<" "jsx_text") parent 0)
|
`(((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
|
(defvar js--treesit-indent-rules
|
||||||
(let ((switch-case (rx "switch_" (or "case" "default"))))
|
(let ((switch-case (rx "switch_" (or "case" "default"))))
|
||||||
|
|
|
||||||
|
|
@ -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)))
|
((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset)))
|
||||||
(treesit-query-error
|
(treesit-query-error
|
||||||
`(((match "<" "jsx_text") parent 0)
|
`(((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 _)
|
(defun typescript-ts-mode--anchor-decl (_n parent &rest _)
|
||||||
"Return the position after the declaration keyword before PARENT.
|
"Return the position after the declaration keyword before PARENT.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue