GNU bug report logs -
#71998
31.0.50; Typescript grammar v0.21.2 causes test failure
Previous Next
Reported by: john muhl <jm <at> pub.pink>
Date: Mon, 8 Jul 2024 15:14:01 UTC
Severity: normal
Found in version 31.0.50
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Theodor Thornhill <theo <at> thornhill.no> writes:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: john muhl <jm <at> pub.pink>
>>> Date: Tue, 16 Jul 2024 18:59:01 -0500
>>>
>>> john muhl <jm <at> 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)))
```
This bug report was last modified 86 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.