From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 62086@debbugs.gnu.org
Subject: bug#62086: 29.0.60; ruby-ts-mode regressions
Date: Tue, 11 Apr 2023 19:53:53 +0300 [thread overview]
Message-ID: <86y1myxsrq.fsf@mail.linkov.net> (raw)
In-Reply-To: <9ceb589f-9325-1607-d1b5-5fd56cb8c3ec@yandex.ru> (Dmitry Gutov's message of "Wed, 5 Apr 2023 19:36:37 +0300")
[-- Attachment #1: Type: text/plain, Size: 207 bytes --]
I don't know if opening a new bug report is needed.
Actually I'm doing the same thing for more ts-modes -
trying to find a set of node names that match parens/brackets.
So maybe this patch makes sense too:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: treesit-sexp-type-regexp.patch --]
[-- Type: text/x-diff, Size: 1796 bytes --]
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index d773b4a41f4..e55d26177af 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -927,7 +927,9 @@ c-ts-base-mode
"qualifier"
"type"
"parameter"
- "expression"
+ ;; "expression"
+ "argument_list"
+ "identifier"
"literal"
"string")))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f68ecb6fa6c..3876a5b54f1 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3827,7 +3827,9 @@ js--treesit-sentence-nodes
"See `treesit-sentence-type-regexp' for more information.")
(defvar js--treesit-sexp-nodes
- '("expression"
+ '("expression" ;; SHOULD NOT MATCH "expression_statement", BUT SHOULD MATCH "parenthesized_expression"
+ "parenthesized_expression"
+ "formal_parameters"
"pattern"
"array"
"function"
@@ -3845,7 +3847,13 @@ js--treesit-sexp-nodes
"undefined"
"arguments"
"pair"
- "jsx")
+ "jsx"
+ "statement_block"
+ "object"
+ "object_pattern"
+ "named_imports"
+ "class_body"
+ )
"Nodes that designate sexps in JavaScript.
See `treesit-sexp-type-regexp' for more information.")
@@ -3893,7 +3901,7 @@ js-ts-mode
(regexp-opt js--treesit-sentence-nodes))
(setq-local treesit-sexp-type-regexp
- (regexp-opt js--treesit-sexp-nodes))
+ (rx-to-string `(seq bol (or ,@js--treesit-sexp-nodes) eol)))
;; Fontification.
(setq-local treesit-font-lock-settings js--treesit-font-lock-settings)
next prev parent reply other threads:[~2023-04-11 16:53 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 17:24 bug#62086: 29.0.60; ruby-ts-mode regressions Juri Linkov
2023-03-09 18:08 ` Eli Zaretskii
2023-03-10 7:29 ` Juri Linkov
2023-03-09 22:02 ` Dmitry Gutov
2023-03-10 7:35 ` Juri Linkov
2023-03-10 16:37 ` Dmitry Gutov
2023-04-03 16:29 ` Juri Linkov
2023-04-03 20:42 ` Dmitry Gutov
2023-04-04 7:16 ` Juri Linkov
2023-04-05 0:06 ` Dmitry Gutov
2023-04-05 6:24 ` Juri Linkov
2023-04-05 14:58 ` Dmitry Gutov
2023-04-05 16:25 ` Juri Linkov
2023-04-05 16:36 ` Dmitry Gutov
2023-04-11 16:53 ` Juri Linkov [this message]
2023-04-11 23:30 ` Dmitry Gutov
2023-04-12 7:05 ` Yuan Fu
2023-04-12 15:31 ` Dmitry Gutov
2023-04-12 20:13 ` Dmitry Gutov
2023-04-12 21:50 ` Yuan Fu
2023-04-12 21:56 ` Dmitry Gutov
2023-04-12 22:11 ` Yuan Fu
2023-04-15 0:08 ` Yuan Fu
2023-04-13 17:42 ` Juri Linkov
2023-04-14 17:03 ` Juri Linkov
2023-04-12 7:30 ` Eli Zaretskii
2023-04-12 15:31 ` Dmitry Gutov
2023-04-12 15:40 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86y1myxsrq.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=62086@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.