From af658f2cef356d6d3908e0e6f8bb310c98a84fc6 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sat, 11 Jan 2025 19:39:56 +0200 Subject: [PATCH] * lisp/progmodes/typescript-ts-mode.el: Fix syntax of tsx tags. (tsx-ts--s-p-query): Bind 'jsx_opening_element' and 'jsx_closing_element' to @jsx to be able to use the < and > syntax for angle brackets in 'tsx-ts--syntax-propertize-captures' (bug#73978). (cherry picked from commit fafcc8458e805e5c7d7785aa7e943bacfadcf79d) --- lisp/progmodes/typescript-ts-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index ac753ed4266..9b2964c5faf 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -658,7 +658,9 @@ at least 3 (which is the default value)." (when (treesit-available-p) (treesit-query-compile 'tsx '(((regex pattern: (regex_pattern) @regexp)) - ((jsx_text) @jsx))))) + ((jsx_text) @jsx) + ((jsx_opening_element) @jsx) + ((jsx_closing_element) @jsx))))) (defun typescript-ts--syntax-propertize (beg end) (let ((captures (treesit-query-capture 'typescript typescript-ts--s-p-query beg end))) -- 2.39.5