From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roman Rudakov Newsgroups: gmane.emacs.bugs Subject: bug#66646: 29.1.90; No tsx syntax highlithting in typescript-ts-mode Date: Sat, 21 Oct 2023 10:18:20 +0200 Message-ID: References: <00efa4c9-187d-38b3-0da9-4cab39b376ad@gutov.dev> <5fcf9c22-d272-c039-cb2d-9a7c9a2dfb8e@gutov.dev> Reply-To: rrudakov@fastmail.com Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39831"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.7; emacs 29.1.90 Cc: 66646@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 21 10:20:43 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qu7Dt-000A9t-Ha for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 10:20:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qu7Do-0000UI-El; Sat, 21 Oct 2023 04:20:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qu7Dm-0000Jx-OJ for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 04:20:34 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qu7Dm-0004is-GX for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 04:20:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qu7ED-00087X-SD for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 04:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Roman Rudakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2023 08:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66646 X-GNU-PR-Package: emacs Original-Received: via spool by 66646-submit@debbugs.gnu.org id=B66646.169787641031140 (code B ref 66646); Sat, 21 Oct 2023 08:21:01 +0000 Original-Received: (at 66646) by debbugs.gnu.org; 21 Oct 2023 08:20:10 +0000 Original-Received: from localhost ([127.0.0.1]:42143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qu7DO-00086C-52 for submit@debbugs.gnu.org; Sat, 21 Oct 2023 04:20:10 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qu7DJ-00085Z-8w for 66646@debbugs.gnu.org; Sat, 21 Oct 2023 04:20:09 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 92CD55C00F8; Sat, 21 Oct 2023 04:19:30 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 21 Oct 2023 04:19:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to :reply-to:sender:subject:subject:to:to; s=fm3; t=1697876370; x= 1697962770; bh=1Mey7dR9RZXn24U18FJlVlqrhUz4T4VzAe+LkHKa6Rc=; b=Y Th3t06ymV3JG9Om6Rvx16OwrMYHPaGR6FCaSdQFJ1ZR0p1lVueCUtxiJQACrjx6t cUsq5WDRzNPIfHMwG1w3W9PosOaDZngpuzKt+hIbtqXAVgwzbLYd/IQqHA/aQpwF gXCK47tJLcmzH4/nAiwl4Hjwi+Y4WHomcWNSAnQvwGAuS1mWEB7FN+CG2BpUQ4xn Hz5yuP5TABloEPDZQEFxodZgZIRgRlNuhXnz92Txl6Ermm/CeoNDbBfdM54ZHPoB hZaG70iTiO8LDXURKRBzr9VayB0a3qI6Ea8JnD52UeJA5ZxCSlECOmNTkE5e1/Z6 S3RyNB8tp1VXJHcRgI1pA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1697876370; x=1697962770; bh=1 Mey7dR9RZXn24U18FJlVlqrhUz4T4VzAe+LkHKa6Rc=; b=Oytowk67C88NCq7l1 HPqxcioQ/FGDe5ibedpRYsJKLXGzZOI6tcNS9/KiYUcol8DSzpMId1eAYU1s8h8G YSiTLnYthTRaggfjtm9WLtRrfKgNsJrgk7FZpr543hBpe4fU1uVLdiQPFAtjKDgG LWT9Rfsy0SEA5VWu1NyA67dzLM/p7lY8lNnlmqhjNszhmpGG5VLoziEPmp8rdH3C UIAroEX9nIc4tVQLHD9W3Yj5DXdYi/e+3omysMqxDFVivHizc6KS1Y7M6bTemkkG mz0X3dbdNYjplCCbrt0Y3m05St9JZi5hTi280xf59IGJUnmiob/mXlc9NpUVsN4X gwHFA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkedtucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfhgfhffvvefuffhrjgfkgggtsehttdertddtredtnecuhfhrohhmpeftohhmrghnucft uhgurghkohhvuceorhhruhgurghkohhvsehfrghsthhmrghilhdrtghomheqnecuggftrf grthhtvghrnhepieejheevhefhlefhhfeuteeijeelleefudejtddtudekveeghefftedu hfffieeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprhhruhgurghkohhvsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i1c714620:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Oct 2023 04:19:29 -0400 (EDT) In-reply-to: <5fcf9c22-d272-c039-cb2d-9a7c9a2dfb8e@gutov.dev> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272839 Archived-At: Dmitry Gutov writes: > On 20/10/2023 19:26, Roman Rudakov wrote: >> Dmitry Gutov 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@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