From 71bc060e4031bee83ec79354bff526fa8a27a81d Mon Sep 17 00:00:00 2001 From: dannyfreeman Date: Mon, 7 Aug 2023 15:55:27 -0400 Subject: [PATCH] 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) --- lisp/progmodes/js.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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." ((parent-is "statement_block") parent-bol js-indent-level) ;; JSX - (js-jsx--treesit-indent-compatibility-bb1f97b) + ,@(js-jsx--treesit-indent-compatibility-bb1f97b) ((node-is "jsx_closing_element") parent 0) ((match "jsx_element" "statement") parent js-indent-level) ((parent-is "jsx_element") parent js-indent-level) -- 2.39.5