GNU bug report logs - #66646
29.1.90; No tsx syntax highlithting in typescript-ts-mode

Previous Next

Package: emacs;

Reported by: rrudakov <at> fastmail.com

Date: Fri, 20 Oct 2023 10:15:01 UTC

Severity: normal

Found in version 29.1.90

Fixed in version 29.2

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 66646-done <at> debbugs.gnu.org, rrudakov <at> fastmail.com
Subject: bug#66646: 29.1.90; No tsx syntax highlithting in typescript-ts-mode
Date: Sat, 21 Oct 2023 11:20:23 -0700

> On Oct 21, 2023, at 5:08 AM, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
> 
> Version: 29.2
> 
> On 21/10/2023 11:18, Roman Rudakov wrote:
>> Dmitry Gutov <dmitry <at> gutov.dev> writes:
>>> On 20/10/2023 19:26, Roman Rudakov wrote:
>>>> Dmitry Gutov <dmitry <at> gutov.dev> writes:
>>>> 
>>>>> On 20/10/2023 13:13, Roman Rudakov wrote:
>>>>>> - install the latest typescript/tsx grammar.
>>>>>> - open a .tsx source file
>>>>>> I'm getting the following error in the *Messages* buffer:
>>>>>> Error during redisplay: (jit-lock-function 1) signaled
>>>>>> (treesit-query-error "Structure error at" 22 "(jsx_opening_element
>>>>>> [(nested_identifier (identifier)) (identifier)]
>>>>>> @typescript-ts-jsx-tag-face) (jsx_closing_element
>>>>>> [(nested_identifier (identifier)) (identifier)]
>>>>>> @typescript-ts-jsx-tag-face) (jsx_self_closing_element
>>>>>> [(nested_identifier (identifier)) (identifier)]
>>>>>> @typescript-ts-jsx-tag-face) (jsx_attribute (property_identifier)
>>>>>> @typescript-ts-jsx-attribute-face)" "Debug the query with
>>>>>> `treesit-query-validate'")
>>>>> 
>>>>> Could you somehow describe which version of the typescript grammar
>>>>> you're using? Did you just pull and build it today from github's
>>>>> master? Or is it from a distro, etc.
>>>> I used steps from admin/notes/tree-sitter/starter-guide from emacs
>>>> git repository. The grammars were built today, but I noticed this
>>>> problem a few weeks ago.
>>>> The grammars were built using the following command:
>>>> git clone git <at> github.com:casouri/tree-sitter-module.git cd
>>>> tree-sitter-module ./batch.sh
>>>> and then copied from dist/ directory to ~/.emacs.d/tree-sitter/
>>> 
>>> Thank you, I've installed the latest version and saw this too.
>>> 
>>> And chance you could you test this patch?
>>> 
>>> diff --git a/lisp/progmodes/typescript-ts-mode.el
>>> b/lisp/progmodes/typescript-ts-mode.el
>>> index 01a021c64fc..b976145dbf3 100644
>>> --- a/lisp/progmodes/typescript-ts-mode.el
>>> +++ b/lisp/progmodes/typescript-ts-mode.el
>>> @@ -166,7 +166,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b
>>>    ;; but then raises an error if the wrong node type is used. So it    is
>>>    ;; important to check with the new node type (member_expression)
>>>    (condition-case nil
>>> -      (progn (treesit-query-capture language '(jsx_opening_element
>>>        (member_expression) @capture))
>>> +      (progn (treesit-query-capture language '((jsx_opening_element
>>> (member_expression) @capture)))
>>>           '((jsx_opening_element
>>>          [(member_expression (identifier)) (identifier)]
>>>          @typescript-ts-jsx-tag-face)
>> Hello, Dmitry! Yes, I can confirm that after applying your patch the problem is fixed for me. Thank you.
> 
> Thanks for checking, pushed to emacs-29.
> 

Awesome, thank you!

Yuan



This bug report was last modified 1 year and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.