Improve treesit settings for js/typescript/ruby-ts-mode (bug#73404)

* lisp/progmodes/js.el (js--treesit-list-nodes):
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--list-nodes):
Replace leaf "string" with "template_string" and "template_substitution"
that can contain more nodes.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Add the 'sentence' thing to treesit-thing-settings.
This commit is contained in:
Juri Linkov 2025-03-06 20:22:50 +02:00
parent 82affcaeff
commit 63cc542b94
3 changed files with 10 additions and 2 deletions

View file

@ -3919,7 +3919,8 @@ See `treesit-thing-settings' for more information.")
"jsx_element"
"jsx_expression"
"jsx_self_closing_element"
"string"
"template_string"
"template_substitution"
"regex"
"arguments"
"class_body"

View file

@ -1253,6 +1253,11 @@ leading double colon is not added."
"hash")
eos)
#'ruby-ts--list-p))
(sentence ,(rx bos (or "return"
"body_statement"
"call"
"assignment")
eos))
(text ,(lambda (node)
(or (member (treesit-node-type node)
'("comment" "string_content" "heredoc_content"))

View file

@ -495,12 +495,14 @@ See `treesit-thing-settings' for more information.")
"object_pattern"
"array"
"array_pattern"
"string"
"template_string"
"template_substitution"
"regex"
"arguments"
"class_body"
"formal_parameters"
"computed_property_name"
;; TypeScript
"decorator_parenthesized_expression"
"enum_body"
"parenthesized_type"