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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66646 in the body.
You can then email your comments to 66646 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 10:15:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to rrudakov <at> fastmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 20 Oct 2023 10:15:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Roman Rudakov <rrudakov <at> fastmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.1.90; No tsx syntax highlithting in typescript-ts-mode
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'")


In GNU Emacs 29.1.90 (build 1, aarch64-apple-darwin23.0.0, NS
appkit-2487.00 Version 14.0 (Build 23A344)) of 2023-10-20 built on
Romans-MBP.home
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.0

Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
--infodir=/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c/share/info/emacs
--prefix=/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c --with-xml2
--with-gnutls --with-native-compilation --without-compress-install
--without-dbus --without-imagemagick --with-modules --with-rsvg
--without-pop --with-xwidgets --with-ns --disable-ns-self-contained
'CFLAGS=-Os -w -pipe -mmacosx-version-min=14
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT'
'CPPFLAGS=-I/opt/homebrew/opt/zlib/include
-I/opt/homebrew/opt/jpeg/include -I/opt/homebrew/opt/readline/include
-I/opt/homebrew/opt/icu4c/include -isystem/opt/homebrew/include
-F/opt/homebrew/Frameworks
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk'
'LDFLAGS=-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/jpeg/lib
-L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/icu4c/lib
-L/opt/homebrew/lib -F/opt/homebrew/Frameworks
-Wl,-headerpad_max_install_names
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
-L/opt/homebrew/opt/libgccjit/lib''
Configured features:
ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB
Important settings:
 value of $LC_CTYPE: UTF-8
 value of $LANG: en_US.UTF-8
 locale-coding-system: utf-8

Major mode: Lisp Interaction

Minor modes in effect:
 corfu-popupinfo-mode: t
 pdf-occur-global-minor-mode: t
 erc-list-mode: t
 erc-menu-mode: t
 erc-autojoin-mode: t
 erc-ring-mode: t
 erc-track-mode: t
 erc-match-mode: t
 erc-log-mode: t
 erc-netsplit-mode: t
 erc-autoaway-mode: t
 erc-button-mode: t
 erc-fill-mode: t
 erc-stamp-mode: t
 erc-irccontrols-mode: t
 erc-noncommands-mode: t
 erc-move-to-prompt-mode: t
 erc-readonly-mode: t
 erc-networks-mode: t
 mu4e-column-faces-mode: t
 mu4e-modeline-mode: t
 TeX-PDF-mode: t
 csv-field-index-mode: t
 auto-insert-mode: t
 flymake-mode: t
 idle-highlight-mode: t
 dtrt-indent-mode: t
 yas-minor-mode: t
 paredit-mode: t
 smartparens-global-strict-mode: t
 smartparens-strict-mode: t
 smartparens-mode: t
 magit-todos-mode: t
 hl-todo-mode: t
 global-diff-hl-mode: t
 global-git-commit-mode: t
 magit-auto-revert-mode: t
 winum-mode: t
 org-roam-db-autosync-mode: t
 global-corfu-mode: t
 corfu-mode: t
 vertico-multiform-mode: t
 vertico-mode: t
 minions-mode: t
 save-place-mode: t
 savehist-mode: t
 subword-mode: t
 recentf-mode: t
 global-auto-revert-mode: t
 shell-dirtrack-mode: t
 global-hl-line-mode: t
 delete-selection-mode: t
 outline-minor-mode: t
 override-global-mode: t
 global-eldoc-mode: t
 eldoc-mode: t
 show-paren-mode: t
 electric-indent-mode: t
 mouse-wheel-mode: t
 tab-bar-mode: t
 menu-bar-mode: t
 file-name-shadow-mode: t
 global-font-lock-mode: t
 font-lock-mode: t
 blink-cursor-mode: t
 window-divider-mode: t
 column-number-mode: t
 line-number-mode: t
 transient-mark-mode: t
 auto-composition-mode: t
 auto-encryption-mode: t
 auto-compression-mode: t
 hs-minor-mode: t

Load-path shadows:
/Users/rrudakov/.emacs.d/elpa/hydra-0.15.0/lv hides 
/Users/rrudakov/.emacs.d/elpa/lv-0.15.0/lv
/Users/rrudakov/.emacs.d/elpa/ef-themes-1.3.0.0.20231014.41130/theme-loaddefs 
hides /Users/rrudakov/.emacs.d/elpa/modus-themes-4.3.0/theme-loaddefs
/Users/rrudakov/.emacs.d/elpa/password-store-20230503.619/password-store 
hides /opt/homebrew/share/emacs/site-lisp/pass/password-store
/Users/rrudakov/.emacs.d/elpa/transient-0.4.3/transient hides 
/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c/share/emacs/29.1.90/lisp/transient
/Users/rrudakov/.emacs.d/elpa/ef-themes-1.3.0.0.20231014.41130/theme-loaddefs 
hides 
/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c/share/emacs/29.1.90/lisp/theme-loaddefs
/Users/rrudakov/.emacs.d/elpa/flymake-1.3.6/flymake hides 
/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c/share/emacs/29.1.90/lisp/progmodes/flymake
/Users/rrudakov/.emacs.d/elpa/project-0.10.0/project hides 
/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c/share/emacs/29.1.90/lisp/progmodes/project
/Users/rrudakov/.emacs.d/elpa/eglot-1.15/eglot hides 
/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c/share/emacs/29.1.90/lisp/progmodes/eglot
/Users/rrudakov/.emacs.d/elpa/eldoc-1.14.0/eldoc hides 
/opt/homebrew/Cellar/emacs-plus <at> 29/HEAD-b99d12c/share/emacs/29.1.90/lisp/emacs-lisp/eldoc

Features:
(shadow emacsbug cursor-sensor checkdoc corfu-popupinfo init babashka
org-git ghub-graphql treepy gsexp ghub url-http url-gw nsm url-auth
literate-calc-mode calc-prog calc-ext gif-screencast
google-translate-smooth-ui google-translate-core-ui popup
google-translate-core google-translate-backend password-store-otp
password-store auth-source-pass nov esxml-query pdf-occur tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet pdf-isearch
let-alist pdf-misc pdf-tools pdf-view jka-compr pdf-cache pdf-info tq
pdf-util pdf-macs ob-restclient restclient elfeed-show elfeed-search
org-duration org-eldoc oc-basic bibtex elfeed-csv elfeed elfeed-curl
elfeed-log elfeed-db elfeed-lib url-queue xml-query erc-list erc-menu
erc-join erc-ring erc-pcomplete erc-track erc-match erc-log 
erc-netsplit
erc-autoaway erc-hl-nicks erc-button erc-fill erc-stamp erc-goodies 
erc
erc-backend erc-networks erc-common erc-compat erc-loaddefs
mu4e-column-faces inline mu4e-icalendar gnus-icalendar icalendar mu4e
mu4e-org mu4e-notification mu4e-main mu4e-view mu4e-headers 
mu4e-compose
mu4e-draft mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks
mu4e-mark mu4e-message flow-fill mu4e-contacts mu4e-update 
mu4e-folders
mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars
mu4e-helpers mu4e-config mu4e-window ido mu4e-obsolete rust-ts-mode
dockerfile-ts-mode smartparens-lua lua-mode groovy-mode yaml-ts-mode
smartparens-haskell haskell-mode haskell-cabal haskell-utils
haskell-font-lock haskell-indentation haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-complete-module haskell-ghc-support etags fileloop dabbrev
haskell-customize latex-mode-expansions smartparens-latex latex
latex-flymake tex-ispell tex-style font-latex tex texmathp
pip-requirements py-yapf blacken pyvenv eshell esh-cmd esh-ext esh-opt
esh-proc esh-io esh-arg esh-module esh-groups esh-util
web-mode-expansions web-mode disp-table typescript-ts-mode
js-mode-expansions smartparens-javascript js google-java-format
cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus cc-cmds 
cc-styles
cc-align cc-engine cc-vars cc-defs add-node-modules-path prettier-js
clj-refactor hydra lv inflections cider tramp-sh cider-debug
cider-browse-ns cider-mode cider-xref-backend cider-find 
cider-inspector
cider-completion cider-profile cider-eval cider-jar arc-mode
archive-mode cider-repl-history pulse cider-repl cider-resolve
cider-test cider-overlays cider-stacktrace cider-doc cider-browse-spec
cider-clojuredocs cider-eldoc cider-docstring cider-client 
cider-common
cider-completion-context cider-connection cider-util cider-popup
sesman-browser nrepl-client queue nrepl-dict spinner parseedn
parseclj-parser parseclj-lex parseclj-alist clojure-mode-expansions
smartparens-clojure sesman clojure-mode lisp-mnt align java-ts-mode
c-ts-common sql-indent sql view pkgbuild-mode sh-script smie 
executable
logview datetime extmap bindat vlf-setup vlf vlf-base vlf-tune 
csv-mode
sort nginx-mode vimrc-mode ssh-config-mode xml-format reformatter
nxml-mode-expansions rng-nxml rng-valid nxml-mode nxml-outln nxml-rap
html-mode-expansions smartparens-html sgml-mode facemenu
smartparens-markdown markdown-mode edit-indirect color eglot
external-completion jsonrpc ert debug backtrace google-c-style bicycle
hideshow autoinsert flymake-kondor consult flymake-proc flymake
idle-highlight-mode dtrt-indent yasnippet rg rg-info-hack rg-menu
rg-ibuffer rg-result wgrep-rg wgrep rg-history rg-header ibuf-ext avy
flyspell-correct expand-region subword-mode-expansions
text-mode-expansions the-org-mode-expansions
python-el-fgallina-expansions er-basic-expansions expand-region-core
expand-region-custom multiple-cursors mc-hide-unmatched-lines-mode
mc-separate-operations rectangular-region-mode mc-mark-pop 
mc-mark-more
mc-cycle-cursors mc-edit-lines multiple-cursors-core paredit
smartparens-rust smartparens-org smartparens-config smartparens-text
smartparens-python smartparens cl git-link thingatpt 
gitignore-templates
magit-todos pcre2el rxt ef-melissa-dark-theme ef-themes hl-todo f
f-shortdoc s grep diff-hl log-view vc-dir ewoc vc vc-dispatcher
magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch 
magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
which-func magit-diff smerge-mode diff diff-mode git-commit log-edit
pcvs-util add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor server magit-mode transient
edmacro kmacro magit-git magit-utils crm winum comp comp-cstr warnings
org-roam-migrate org-roam-log org-roam-mode org-roam-capture 
org-roam-id
org-roam-node org-roam-db emacsql-sqlite-builtin sqlite org-roam-utils
org-roam-compat org-roam org-capture org-attach emacsql-sqlite
emacsql-sqlite-common emacsql emacsql-compiler magit-section
org-tree-slide face-remap org-timer async ob-async ob-plantuml 
ob-ditaa
ob-clojure ob-haskell ob-sqlite ob-shell ob-sql ob-python python pcase
treesit org-clock appt diary-lib diary-loaddefs ox-jira ox-confluence
org-contrib ox-slack ox-gfm ox-md ox-odt rng-loc rng-uri rng-parse
rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok
nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox
org-agenda org-element org-persist org-id org-refile avl-tree 
generator
ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime 
smime
dig gnus-sum shr-tag-pre-highlight language-detection shr pixel-fill
kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus
gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int
gnus-range message sendmail yank-media rfc822 mml mml-sec epa derived
epg rfc6068 mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util mail-utils range mm-util mail-prsvr alert log4e
notifications dbus xml gntp exec-path-from-shell cape corfu
vertico-directory vertico-multiform vertico minions compat hippie-exp
bookmark re-builder advice flyspell ispell calc calc-loaddefs rect
calc-macs dired-subtree dired-hacks-utils dash dired-git-info
image-dired image-dired-tags image-dired-external image-dired-util xdg
dired-aux xref project saveplace savehist compile text-property-search
ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help 
ediff-init
ediff-util cap-words superword subword ibuffer ibuffer-loaddefs imenu
epg-config recentf tree-widget autorevert filenotify tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
parse-time iso8601 image-mode dired dired-loaddefs exif conf-mode
hl-line gnutls puny delsel novice cl-extra help-mode mysecret org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint
org-pcomplete pcomplete comint ansi-osc ansi-color ring org-list
org-footnote org-faces org-entities time-date noutline outline
ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold
org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar
cal-loaddefs org-version org-compat org-macs format-spec use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
cus-edit pp cus-load icons wid-edit add-node-modules-path-autoloads
alert-autoloads auctex-autoloads tex-site avy-autoloads
bicycle-autoloads blacken-autoloads cape-autoloads
clj-refactor-autoloads cider-autoloads clojure-mode-autoloads
consult-autoloads corfu-autoloads csv-mode-autoloads diff-hl-autoloads
dired-git-info-autoloads dired-subtree-autoloads
dired-hacks-utils-autoloads dtrt-indent-autoloads
edit-indirect-autoloads ef-themes-autoloads eglot-autoloads
elfeed-autoloads emacs-everywhere-autoloads erc-hl-nicks-autoloads
exec-path-from-shell-autoloads expand-region-autoloads 
flymake-autoloads
eldoc-autoloads flymake-kondor-autoloads flyspell-correct-autoloads
ghub-autoloads gif-screencast-autoloads git-link-autoloads
gitignore-templates-autoloads gntp-autoloads google-c-style-autoloads
google-translate-autoloads groovy-mode-autoloads 
haskell-mode-autoloads
hydra-autoloads idle-highlight-mode-autoloads inflections-autoloads
literate-calc-mode-autoloads log4e-autoloads logview-autoloads
datetime-autoloads extmap-autoloads lua-mode-autoloads lv-autoloads
magit-todos-autoloads magit-autoloads git-commit-autoloads
hl-todo-autoloads f-autoloads markdown-mode-autoloads 
minions-autoloads
modus-themes-autoloads mu4e-column-faces-autoloads
multiple-cursors-autoloads nginx-mode-autoloads nov-autoloads
esxml-autoloads kv-autoloads ob-async-autoloads async-autoloads
ob-restclient-autoloads org-contrib-autoloads org-roam-autoloads
magit-section-autoloads emacsql-autoloads org-tree-slide-autoloads
ox-jira-autoloads ox-slack-autoloads ox-gfm-autoloads 
paredit-autoloads
parseedn-autoloads parseclj-autoloads password-store-otp-autoloads
password-store-autoloads pcre2el-autoloads pdf-tools-autoloads
pip-requirements-autoloads rx pkgbuild-mode-autoloads
plantuml-mode-autoloads popup-autoloads prettier-js-autoloads
project-autoloads py-yapf-autoloads pyvenv-autoloads queue-autoloads
rainbow-mode-autoloads restclient-autoloads rg-autoloads s-autoloads
sesman-autoloads shr-tag-pre-highlight-autoloads
language-detection-autoloads smartparens-autoloads spinner-autoloads
sql-indent-autoloads ssh-config-mode-autoloads tablist-autoloads
transient-autoloads treepy-autoloads vertico-autoloads
vimrc-mode-autoloads vlf-autoloads web-mode-autoloads wgrep-autoloads
winum-autoloads dash-autoloads with-editor-autoloads info
compat-autoloads xml-format-autoloads reformatter-autoloads
yasnippet-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl 
tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks 
lisp-float-type
elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode 
register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet 
lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj 
charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray 
oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable 
backquote
threads xwidget-internal kqueue cocoa ns lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 1223899 100483)
(symbols 48 79529 41)
(strings 32 346265 51837)
(string-bytes 1 10766694)
(vectors 16 324423)
(vector-slots 8 3933637 344067)
(floats 8 91632 471)
(intervals 56 1974 484)
(buffers 984 15))

-- 
Best regards, Roman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 10:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rrudakov <at> fastmail.com
Cc: 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90;
 No tsx syntax highlithting in typescript-ts-mode
Date: Fri, 20 Oct 2023 13:33:45 +0300
> From: Roman Rudakov <rrudakov <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 13:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Roman Rudakov <rrudakov <at> fastmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Fri, 20 Oct 2023 15:17:01 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Roman Rudakov <rrudakov <at> 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.

[Button.tsx (text/plain, attachment)]
[Message part 3 (text/plain, inline)]

--
Best regards, Roman

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 13:34:02 GMT) Full text and rfc822 format available.

Message #14 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rrudakov <at> fastmail.com, João Távora
 <joaotavora <at> gmail.com>
Cc: 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Fri, 20 Oct 2023 16:32:59 +0300
> From: Roman Rudakov <rrudakov <at> fastmail.com>
> Cc: 66646 <at> debbugs.gnu.org
> Date: Fri, 20 Oct 2023 15:17:01 +0200
> 
> > 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.

Thanks, but in that case I cannot debug this because I don't have a
Typescript LSP server installed.  Someone else will need to do that.

Adding João in case he has some inputs or suggestions.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 15:59:02 GMT) Full text and rfc822 format available.

Message #17 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Roman Rudakov <rrudakov <at> fastmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: João Távora <joaotavora <at> gmail.com>,
 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Fri, 20 Oct 2023 17:56:56 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Roman Rudakov <rrudakov <at> fastmail.com>
>> Cc: 66646 <at> debbugs.gnu.org
>> Date: Fri, 20 Oct 2023 15:17:01 +0200
>>
>> > 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.
>
> Thanks, but in that case I cannot debug this because I don't have a
> Typescript LSP server installed.  Someone else will need to do that.
>
> Adding João in case he has some inputs or suggestions.

As I mentioned, having language server installed is not necessary. I 
was able to reproduce the problem without it. Eglot will just print an 
error to the *Messages* buffer, but the problem with syntax 
highlighting should still be reproducible.
--
Best regards, Roman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 16:02:01 GMT) Full text and rfc822 format available.

Message #20 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: rrudakov <at> fastmail.com, 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Fri, 20 Oct 2023 19:00:58 +0300
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 16:30:02 GMT) Full text and rfc822 format available.

Message #23 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Roman Rudakov <rrudakov <at> fastmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Fri, 20 Oct 2023 18:26:12 +0200
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/
--
Best regards, Roman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Fri, 20 Oct 2023 22:55:02 GMT) Full text and rfc822 format available.

Message #26 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: rrudakov <at> fastmail.com
Cc: 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Sat, 21 Oct 2023 01:53:41 +0300
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)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Sat, 21 Oct 2023 08:21:01 GMT) Full text and rfc822 format available.

Message #29 received at 66646 <at> debbugs.gnu.org (full text, mbox):

From: Roman Rudakov <rrudakov <at> fastmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 66646 <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Sat, 21 Oct 2023 10:18:20 +0200
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.

--
Best regards, Roman




Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Sat, 21 Oct 2023 12:10:03 GMT) Full text and rfc822 format available.

Notification sent to rrudakov <at> fastmail.com:
bug acknowledged by developer. (Sat, 21 Oct 2023 12:10:03 GMT) Full text and rfc822 format available.

Message #34 received at 66646-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: rrudakov <at> fastmail.com
Cc: 66646-done <at> debbugs.gnu.org
Subject: Re: bug#66646: 29.1.90; No tsx syntax highlithting in
 typescript-ts-mode
Date: Sat, 21 Oct 2023 15:08:38 +0300
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66646; Package emacs. (Sat, 21 Oct 2023 18:22:01 GMT) Full text and rfc822 format available.

Message #37 received at 66646-done <at> debbugs.gnu.org (full text, mbox):

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: Re: 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



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Nov 2023 12:24:07 GMT) Full text and rfc822 format available.

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

Previous Next


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