unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
@ 2024-07-08 15:11 john muhl
  2024-07-08 15:18 ` Stefan Kangas
  2024-07-16 23:59 ` john muhl
  0 siblings, 2 replies; 11+ messages in thread
From: john muhl @ 2024-07-08 15:11 UTC (permalink / raw)
  To: 71998

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

The newly released version 0.21.2 of the typescript grammar caused
the typescript-ts-mode tests to start failing.


[-- Attachment #2: typescript-ts-mode-tests.log --]
[-- Type: text/plain, Size: 2319 bytes --]

Running 1 tests (2024-07-07 01:57:30+0000, selector `(not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))')
Test typescript-ts-mode-test-indentation backtrace:
  signal(ert-test-failed (("Mismatch in test \"JSX indentation\", file
  ert-fail(("Mismatch in test \"JSX indentation\", file /home/build/em
  ert-test--erts-test(((code lambda nil (setq indent-tabs-mode nil) (s
  ert-test-erts-file("/home/build/emacs/src/test/lisp/progmodes/typesc
  #f(compiled-function () #<bytecode 0x2f58574ddba7032>)()
  #f(compiled-function () #<bytecode -0x1c279e14ef7e9eb>)()
  handler-bind-1(#f(compiled-function () #<bytecode -0x1c279e14ef7e9eb
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name typescript-ts-mode-test-indentation :
  ert-run-or-rerun-test(#s(ert--stats :selector (not (or (tag :expensi
  ert-run-tests((not (or (tag :expensive-test) (tag :unstable) (tag :n
  ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable) (
  ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
  eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
  command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
  command-line()
  normal-top-level()
Test typescript-ts-mode-test-indentation condition:
    (ert-test-failed
     ("Mismatch in test \"JSX indentation\", file /home/build/emacs/src/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts"
      #("const foo = (props) => {\n  return (\n    <div>\n    <div>\n    <div>\n    <div>\n    {\n      props.foo\n        ? Hello, foo!\n        : Hello, World!;\n    }\n    </div>\n    </div>\n    </div>\n    </div>\n  );\n}\n"
	40 41 (syntax-table (15)) 193 194 (syntax-table (15)))
      "const foo = (props) => {\n  return (\n    <div>\n      <div>\n        <div>\n          <div>\n            {\n              props.foo\n                ? Hello, foo!\n                : Hello, World!;\n            }\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n"))
   FAILED  1/1  typescript-ts-mode-test-indentation (0.097677 sec) at lisp/progmodes/typescript-ts-mode-tests.el:26

Ran 1 tests, 0 results as expected, 1 unexpected (2024-07-07 01:57:30+0000, 0.170821 sec)

1 unexpected results:
   FAILED  typescript-ts-mode-test-indentation


^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  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
  1 sibling, 0 replies; 11+ messages in thread
From: Stefan Kangas @ 2024-07-08 15:18 UTC (permalink / raw)
  To: john muhl, 71998; +Cc: Theodor Thornhill

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.

Theodor, could you please take a look at this?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  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
  1 sibling, 1 reply; 11+ messages in thread
From: john muhl @ 2024-07-16 23:59 UTC (permalink / raw)
  To: 71998

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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-07-20  8:52 UTC (permalink / raw)
  To: john muhl, Theodor Thornhill; +Cc: 71998

> 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?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-20 10:01 UTC (permalink / raw)
  To: Eli Zaretskii, john muhl; +Cc: 71998

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  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
  2024-07-21 12:58         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 11+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-20 10:25 UTC (permalink / raw)
  To: Eli Zaretskii, john muhl; +Cc: 71998

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)))
 
```





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  2024-07-20 10:25       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 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
  0 siblings, 1 reply; 11+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-07-21 12:58 UTC (permalink / raw)
  To: Eli Zaretskii, john muhl; +Cc: 71998

Theodor Thornhill <theo@thornhill.no> writes:

> Theodor Thornhill <theo@thornhill.no> writes:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>>> From: john muhl <jm@pub.pink>


I now synced to latest master, and I can no longer reproduce this. John,
do you still see an issue after syncing with master?

I'll push some small improvements for error handling and tests for
typescript-ts-mode anyways.

Thanks,
Theo





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  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
  0 siblings, 1 reply; 11+ messages in thread
From: john muhl @ 2024-07-21 18:20 UTC (permalink / raw)
  To: Theodor Thornhill; +Cc: Eli Zaretskii, 71998

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

Theodor Thornhill <theo@thornhill.no> writes:

> I now synced to latest master, and I can no longer reproduce this. John,
> do you still see an issue after syncing with master?

I have been testing the emacs-30 branch and still see it there as
of 68615a38669.

On master (ccb856189f4) there are segfaults running the tests for
typescript, c, java and ruby -ts-modes caused by 1abf3bdd7ed.

With that reverted I get the same test failure as on emacs-30.


[-- Attachment #2: typescript-ts-mode-tests.log --]
[-- Type: text/plain, Size: 2308 bytes --]

Running 1 tests (2024-07-21 11:55:33-0500, selector `(not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))')
Test typescript-ts-mode-test-indentation backtrace:
  signal(ert-test-failed (("Mismatch in test \"JSX indentation\", file
  ert-fail(("Mismatch in test \"JSX indentation\", file /home/build/em
  ert-test--erts-test(((code lambda nil (setq indent-tabs-mode nil) (s
  ert-test-erts-file("/home/build/emacs-build/src-minimal/test/lisp/pr
  #f(compiled-function () #<bytecode 0x14a5cebb>)()
  #f(compiled-function () #<bytecode 0x11e6b718>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x11e6b718>) (erro
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name typescript-ts-mode-test-indentation :
  ert-run-or-rerun-test(#s(ert--stats :selector (not (or (tag :expensi
  ert-run-tests((not (or (tag :expensive-test) (tag :unstable) (tag :n
  ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable) (
  ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
  eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
  command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
  command-line()
  normal-top-level()
Test typescript-ts-mode-test-indentation condition:
    (ert-test-failed
     ("Mismatch in test \"JSX indentation\", file /home/build/emacs-build/src-minimal/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts"
      #("const foo = (props) => {\n  return (\n    <div>\n    <div>\n    <div>\n    <div>\n    {\n      props.foo\n\11? Hello, foo!\n\11: Hello, World!;\n    }\n    </div>\n    </div>\n    </div>\n    </div>\n  );\n}\n"
	40 41 (syntax-table (15)) 179 180 (syntax-table (15)))
      "const foo = (props) => {\n  return (\n    <div>\n      <div>\n        <div>\n          <div>\n            {\n              props.foo\n                ? Hello, foo!\n                : Hello, World!;\n            }\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n"))
   FAILED  1/1  typescript-ts-mode-test-indentation (0.503101 sec) at lisp/progmodes/typescript-ts-mode-tests.el:26

Ran 1 tests, 0 results as expected, 1 unexpected (2024-07-21 11:55:33-0500, 0.690149 sec)

1 unexpected results:
   FAILED  typescript-ts-mode-test-indentation


^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  2024-07-21 18:20           ` john muhl
@ 2024-07-21 18:34             ` Eli Zaretskii
  2024-07-21 22:23               ` john muhl
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2024-07-21 18:34 UTC (permalink / raw)
  To: john muhl, Yuan Fu; +Cc: theo, 71998

> From: john muhl <jm@pub.pink>
> Cc: Eli Zaretskii <eliz@gnu.org>,  71998@debbugs.gnu.org
> Date: Sun, 21 Jul 2024 13:20:25 -0500
> 
> On master (ccb856189f4) there are segfaults running the tests for
> typescript, c, java and ruby -ts-modes caused by 1abf3bdd7ed.

Yuan, can you look into these segfaults?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  2024-07-21 18:34             ` Eli Zaretskii
@ 2024-07-21 22:23               ` john muhl
  2024-07-22  0:04                 ` Yuan Fu
  0 siblings, 1 reply; 11+ messages in thread
From: john muhl @ 2024-07-21 22:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Yuan Fu, theo, 71998

Eli Zaretskii <eliz@gnu.org> writes:

>> From: john muhl <jm@pub.pink>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  71998@debbugs.gnu.org
>> Date: Sun, 21 Jul 2024 13:20:25 -0500
>> 
>> On master (ccb856189f4) there are segfaults running the tests for
>> typescript, c, java and ruby -ts-modes caused by 1abf3bdd7ed.
>
> Yuan, can you look into these segfaults?

bug#72238 may be hitting the same issue.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure
  2024-07-21 22:23               ` john muhl
@ 2024-07-22  0:04                 ` Yuan Fu
  0 siblings, 0 replies; 11+ messages in thread
From: Yuan Fu @ 2024-07-22  0:04 UTC (permalink / raw)
  To: john muhl; +Cc: Eli Zaretskii, Theodor Thornhill, 71998



> On Jul 21, 2024, at 3:23 PM, john muhl <jm@pub.pink> wrote:
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
>>> From: john muhl <jm@pub.pink>
>>> Cc: Eli Zaretskii <eliz@gnu.org>,  71998@debbugs.gnu.org
>>> Date: Sun, 21 Jul 2024 13:20:25 -0500
>>> 
>>> On master (ccb856189f4) there are segfaults running the tests for
>>> typescript, c, java and ruby -ts-modes caused by 1abf3bdd7ed.
>> 
>> Yuan, can you look into these segfaults?
> 
> bug#72238 may be hitting the same issue.

Yeah 1abf3bdd7ed kind of exposed a bug, I pushed a fix on master. Sorry about that.

Yuan




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-07-22  0:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).