From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>, john muhl <jm@pub.pink>
Cc: 71998@debbugs.gnu.org
Subject: bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
Date: Sat, 20 Jul 2024 12:25:16 +0200 [thread overview]
Message-ID: <87sew45pir.fsf@thornhill.no> (raw)
In-Reply-To: <87v8105qml.fsf@thornhill.no>
Theodor Thornhill <theo@thornhill.no> writes:
> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: john muhl <jm@pub.pink>
>>> Date: Tue, 16 Jul 2024 18:59:01 -0500
>>>
>>> john muhl <jm@pub.pink> writes:
>>>
>>> > The newly released version 0.21.2 of the typescript grammar caused
>>> > the typescript-ts-mode tests to start failing.
>>>
>>> I was mistaken about the new grammar breaking the test (it just
>>> made it visible). Replacing it with:
>>>
>>> =-=
>>> const foo = (props) => {
>>> return (
>>> <div>
>>> <div>
>>> <div>
>>> <div>
>>> {
>>> props.foo
>>> ? Hello, foo!
>>> : Hello, World!;
>>> }
>>> </div>
>>> </div>
>>> </div>
>>> </div>
>>> );
>>> }
>>> =-=
>>> const foo = (props) => {
>>> return (
>>> <div>
>>> <div>
>>> <div>
>>> <div>
>>> {
>>> props.foo
>>> ? Hello, foo!
>>> : Hello, World!;
>>> }
>>> </div>
>>> </div>
>>> </div>
>>> </div>
>>> );
>>> }
>>> =-=-=
>>>
>>> and running with older grammars (0.19,20,21) also fails.
>>
>> Theo, any ideas, comments or suggestions?
>
> Yeah, it seems it is one of the compat-functions that causes this,
> afaict. Taking a look right now. Probably should be possible to catch
> some errors here.
>
> Theo
It seems this fixes the problems, but I'll try to fix the underlying
issue as well. This change was introduced in
bcf287bd11405b21033466cf0284653e45b54be7, and it looks like this caused
the regression.
Theo
```
diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index 3606a139d50..029705b4137 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -88,7 +88,7 @@ tsx-ts-mode--indent-compatibility-b893426
(progn (treesit-query-capture 'tsx '((jsx_fragment) @capture))
`(((match "<" "jsx_fragment") parent 0)
((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset)))
- (treesit-query-error
+ (error
`(((match "<" "jsx_text") parent 0)
((parent-is "jsx_text") parent typescript-ts-mode-indent-offset)))))
@@ -201,7 +201,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b
(jsx_self_closing_element
[(member_expression (identifier)) (identifier)]
@typescript-ts-jsx-tag-face)))
- (treesit-query-error
+ (error
'((jsx_opening_element
[(nested_identifier (identifier)) (identifier)]
@typescript-ts-jsx-tag-face)
@@ -223,7 +223,7 @@ tsx-ts-mode--font-lock-compatibility-function-expression
(progn (treesit-query-capture language '((function_expression) @cap))
;; New version of the grammar
'function_expression)
- (treesit-query-error
+ (error
;; Old version of the grammar
'function)))
```
next prev parent reply other threads:[~2024-07-20 10:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 15:11 bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure john muhl
2024-07-08 15:18 ` Stefan Kangas
2024-07-16 23:59 ` john muhl
2024-07-20 8:52 ` Eli Zaretskii
2024-07-20 10:01 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-20 10:25 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-07-21 12:58 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-21 18:20 ` john muhl
2024-07-21 18:34 ` Eli Zaretskii
2024-07-21 22:23 ` john muhl
2024-07-22 0:04 ` Yuan Fu
2024-09-20 17:03 ` Mattias Engdegård
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=87sew45pir.fsf@thornhill.no \
--to=bug-gnu-emacs@gnu.org \
--cc=71998@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jm@pub.pink \
--cc=theo@thornhill.no \
/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.