From bcf287bd11405b21033466cf0284653e45b54be7 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 16 Sep 2023 23:03:26 +0300 Subject: [PATCH] typescript-ts-mode.el: Minor touches * lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode--indent-compatibility-b893426) (tsx-ts-mode--font-lock-compatibility-bb1f97b): Catch specific error. (typescript-ts-base-mode): Improve docstring (bug#65470). --- lisp/progmodes/typescript-ts-mode.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index c92c072515e..709d3718a0a 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -87,7 +87,7 @@ Check if a node type is available, then return the right indent rules." (progn (treesit-query-capture 'tsx '((jsx_fragment) @capture)) `(((match "<" "jsx_fragment") parent 0) ((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset))) - (error + (treesit-query-error `(((match "<" "jsx_text") parent 0) ((parent-is "jsx_text") parent typescript-ts-mode-indent-offset))))) @@ -178,7 +178,8 @@ Argument LANGUAGE is either `typescript' or `tsx'." (jsx_self_closing_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face))) - (error '((jsx_opening_element + (treesit-query-error + '((jsx_opening_element [(nested_identifier (identifier)) (identifier)] @typescript-ts-jsx-tag-face) @@ -370,7 +371,9 @@ Argument LANGUAGE is either `typescript' or `tsx'." ;;;###autoload (define-derived-mode typescript-ts-base-mode prog-mode "TypeScript" - "Major mode for editing TypeScript." + "Generic major mode for editing TypeScript. + +This mode is intended to be inherited by concrete major modes." :group 'typescript :syntax-table typescript-ts-mode--syntax-table -- 2.39.2