Subject: Re: bug#71998: 31.0.50; Typescript grammar v0.21.2 causes test failure

From: john muhl <[email-masked]>
Date: Sun, 23 Feb 2025 20:11:50 -0600

Mattias Engdegård <[email-masked]> writes:

>> The newly released version 0.21.2 of the typescript grammar caused
> the typescript-ts-mode tests to start failing.
>
> I still get the exact same test error on master. Is this supposed to be fixed?

I’m still seeing this test failure and a after a little poking
around I found that setting indent-tabs-mode to nil after changing
the major mode in the test setup fixes it for me. I don’t
understand why that’s a problem here and not in other tests but I
tested it on two different systems and they both pass now.

p.s. While looking around I noticed that tree-sitter reports
errors in the code of the “JSX indentation” test. Looks like the
values after the ? & : should be quoted but I don’t know anything
about TS/JSX.

>From db1ce36f41d3552b1e0af0b030bc60dade3cad08 Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
Date: Sun, 23 Feb 2025 20:03:39 -0600
Subject: [PATCH] ; Fix 'typescript-ts-mode' indent test

* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
Set 'indent-tabs-mode' after changing the major mode.
---
 test/lisp/progmodes/typescript-ts-mode-resources/indent.erts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts b/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
index 343eababf54..c5450c0811b 100644
--- a/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
@@ -95,9 +95,9 @@ const foo = () => {
 
 Code:
   (lambda ()
-    (setq indent-tabs-mode nil)
     (setq tsx-ts-mode-indent-offset 2)
     (tsx-ts-mode)
+    (setq indent-tabs-mode nil)
     (indent-region (point-min) (point-max)))
 
 Name: JSX indentation
-- 
2.48.1