bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66646: 29.1.90; No tsx syntax highlithting in typescript-ts-mode


From: Roman Rudakov
Subject: bug#66646: 29.1.90; No tsx syntax highlithting in typescript-ts-mode
Date: Fri, 20 Oct 2023 15:17:01 +0200
User-agent: mu4e 1.10.7; emacs 29.1.90


Eli Zaretskii <eliz@gnu.org> writes:

From: Roman Rudakov <rrudakov@fastmail.com>
Date: Fri, 20 Oct 2023 12:13:15 +0200


- 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'")

I cannot reproduce this. I used a random *.tsx file on my system, and
didn't get any error.  So please post the file you used, and also
describe step by step what to do to reproduce the problem starting
from "emacs -Q".

Thanks.

After some debugging I figured out that it can be only reproduced when `eglot-ensure` is added to `typescript-ts-mode-hook` and `tsx-ts-mode-hook`. So, steps to reproduce are the following: - Optionally install `typescript-language-server` (if it's not installed there will be eglot error, but the original issue will still be reproducible).
- `emacs -Q`
- evaluate the following:

(require 'typescript-ts-mode)
(require 'eglot)
(add-hook 'typescript-ts-mode-hook #'eglot-ensure)
(add-hook 'tsx-ts-mode-hook #'eglot-ensure)

- open attached tsx file.

Attachment: Button.tsx
Description: Random typescript source file



--
Best regards, Roman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]