emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 423e1ee7d6d: Add treesit thing 'sexp-list' to typescript-ts-mode


From: Juri Linkov
Subject: master 423e1ee7d6d: Add treesit thing 'sexp-list' to typescript-ts-mode (bug#73404)
Date: Sun, 22 Dec 2024 14:20:07 -0500 (EST)

branch: master
commit 423e1ee7d6d6f34c0bc249a8dfb14a4a25eae08a
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    Add treesit thing 'sexp-list' to typescript-ts-mode (bug#73404)
    
    * lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode):
    Add 'sexp-list' to 'treesit-thing-settings'.
    (typescript-ts-mode--sexp-list-nodes): New variable.
---
 lisp/progmodes/typescript-ts-mode.el | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/lisp/progmodes/typescript-ts-mode.el 
b/lisp/progmodes/typescript-ts-mode.el
index edca89e5c3a..08c8a71c18e 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -459,6 +459,35 @@ See `treesit-thing-settings' for more information.")
   "Nodes that designate sexps in TypeScript.
 See `treesit-thing-settings' for more information.")
 
+(defvar typescript-ts-mode--sexp-list-nodes
+  '("export_clause"
+    "named_imports"
+    "statement_block"
+    "_for_header"
+    "switch_body"
+    "parenthesized_expression"
+    "object"
+    "object_pattern"
+    "array"
+    "array_pattern"
+    "jsx_expression"
+    "_jsx_string"
+    "string"
+    "regex"
+    "arguments"
+    "class_body"
+    "formal_parameters"
+    "computed_property_name"
+    "decorator_parenthesized_expression"
+    "enum_body"
+    "parenthesized_type"
+    "type_arguments"
+    "object_type"
+    "type_parameters"
+    "tuple_type")
+  "Nodes that designate lists in TypeScript.
+See `treesit-thing-settings' for more information.")
+
 ;;;###autoload
 (define-derived-mode typescript-ts-base-mode prog-mode "TypeScript"
   "Generic major mode for editing TypeScript.
@@ -486,6 +515,7 @@ This mode is intended to be inherited by concrete major 
modes."
   (setq-local treesit-thing-settings
               `((typescript
                  (sexp ,(regexp-opt typescript-ts-mode--sexp-nodes))
+                 (sexp-list ,(regexp-opt typescript-ts-mode--sexp-list-nodes))
                  (sentence ,(regexp-opt
                              typescript-ts-mode--sentence-nodes))
                  (text ,(regexp-opt '("comment"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]