From 0480e9c445d59fd5ec9b38ebe3919fee2aabf8d2 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Fri, 28 Oct 2022 13:36:42 -0700 Subject: [PATCH] ; Make ts-mode indent rules more compact (whitespace change) * lisp/progmodes/ts-mode.el (ts-mode--indent-rules): fold two-line rules into one line. --- lisp/progmodes/ts-mode.el | 57 +++++++++++++-------------------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/lisp/progmodes/ts-mode.el b/lisp/progmodes/ts-mode.el index 1f0a7fd5c40..20118bc3db9 100644 --- a/lisp/progmodes/ts-mode.el +++ b/lisp/progmodes/ts-mode.el @@ -60,48 +60,29 @@ ((node-is ")") parent-bol 0) ((node-is "]") parent-bol 0) ((node-is ">") parent-bol 0) - ((parent-is "ternary_expression") - parent-bol ,ts-mode-indent-offset) - ((parent-is "member_expression") - parent-bol ,ts-mode-indent-offset) - ((parent-is "named_imports") - parent-bol ,ts-mode-indent-offset) - ((parent-is "statement_block") - parent-bol ,ts-mode-indent-offset) - ((parent-is "type_arguments") - parent-bol ,ts-mode-indent-offset) - ((parent-is "variable_declarator") - parent-bol ,ts-mode-indent-offset) - ((parent-is "arguments") - parent-bol ,ts-mode-indent-offset) - ((parent-is "array") - parent-bol ,ts-mode-indent-offset) - ((parent-is "formal_parameters") - parent-bol ,ts-mode-indent-offset) - ((parent-is "template_substitution") - parent-bol ,ts-mode-indent-offset) - ((parent-is "object_pattern") - parent-bol ,ts-mode-indent-offset) - ((parent-is "object") - parent-bol ,ts-mode-indent-offset) - ((parent-is "object_type") - parent-bol ,ts-mode-indent-offset) - ((parent-is "enum_body") - parent-bol ,ts-mode-indent-offset) - ((parent-is "arrow_function") - parent-bol ,ts-mode-indent-offset) - ((parent-is "parenthesized_expression") - parent-bol ,ts-mode-indent-offset) + ((parent-is "ternary_expression") parent-bol ,ts-mode-indent-offset) + ((parent-is "member_expression") parent-bol ,ts-mode-indent-offset) + ((parent-is "named_imports") parent-bol ,ts-mode-indent-offset) + ((parent-is "statement_block") parent-bol ,ts-mode-indent-offset) + ((parent-is "type_arguments") parent-bol ,ts-mode-indent-offset) + ((parent-is "variable_declarator") parent-bol ,ts-mode-indent-offset) + ((parent-is "arguments") parent-bol ,ts-mode-indent-offset) + ((parent-is "array") parent-bol ,ts-mode-indent-offset) + ((parent-is "formal_parameters") parent-bol ,ts-mode-indent-offset) + ((parent-is "template_substitution") parent-bol ,ts-mode-indent-offset) + ((parent-is "object_pattern") parent-bol ,ts-mode-indent-offset) + ((parent-is "object") parent-bol ,ts-mode-indent-offset) + ((parent-is "object_type") parent-bol ,ts-mode-indent-offset) + ((parent-is "enum_body") parent-bol ,ts-mode-indent-offset) + ((parent-is "arrow_function") parent-bol ,ts-mode-indent-offset) + ((parent-is "parenthesized_expression") parent-bol ,ts-mode-indent-offset) ;; TSX - ((parent-is "jsx_opening_element") - parent ,ts-mode-indent-offset) + ((parent-is "jsx_opening_element") parent ,ts-mode-indent-offset) ((node-is "jsx_closing_element") parent 0) - ((parent-is "jsx_element") - parent ,ts-mode-indent-offset) + ((parent-is "jsx_element") parent ,ts-mode-indent-offset) ((node-is "/") parent 0) - ((parent-is "jsx_self_closing_element") - parent ,ts-mode-indent-offset) + ((parent-is "jsx_self_closing_element") parent ,ts-mode-indent-offset) (no-node parent-bol 0))) "Tree-sitter indent rules.") -- 2.39.2