aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordannyfreeman2023-08-07 15:55:27 -0400
committerEli Zaretskii2023-08-10 11:59:13 +0300
commit71bc060e4031bee83ec79354bff526fa8a27a81d (patch)
treecb715587fc5d1c39da37eea99f4ed9d69515b6cc
parent889cfb42ed9e857a7e813bb356bb2b5e588c89c0 (diff)
downloademacs-71bc060e4031bee83ec79354bff526fa8a27a81d.tar.gz
emacs-71bc060e4031bee83ec79354bff526fa8a27a81d.zip
Properly expand the JSX indentation rules in 'js-ts-mode'
* lisp/progmodes/js.el (js--treesit-indent-rules): Fix 'js-ts-mode' indent bug in JSX expressions. Before this change, treesit indent mechanisms were trying to call this compatibility function like a matching or anchor rule. This resulted in an error when running `indent-for-tab-command` while the cursor was in a JSX expression: treesit--simple-indent-eval: Wrong number of arguments: ((cl-struct-js--pitem-tags ido-cur-list t) nil "Indent rules helper, to handle different releases of tree-sitter-javascript." (Bug#65134)
-rw-r--r--lisp/progmodes/js.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index bbe3159f596..c583b6f6191 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3474,7 +3474,7 @@ Check if a node type is available, then return the right indent rules."
3474 ((parent-is "statement_block") parent-bol js-indent-level) 3474 ((parent-is "statement_block") parent-bol js-indent-level)
3475 3475
3476 ;; JSX 3476 ;; JSX
3477 (js-jsx--treesit-indent-compatibility-bb1f97b) 3477 ,@(js-jsx--treesit-indent-compatibility-bb1f97b)
3478 ((node-is "jsx_closing_element") parent 0) 3478 ((node-is "jsx_closing_element") parent 0)
3479 ((match "jsx_element" "statement") parent js-indent-level) 3479 ((match "jsx_element" "statement") parent js-indent-level)
3480 ((parent-is "jsx_element") parent js-indent-level) 3480 ((parent-is "jsx_element") parent js-indent-level)