From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#66646: 29.1.90; No tsx syntax highlithting in typescript-ts-mode Date: Sat, 21 Oct 2023 15:08:38 +0300 Message-ID: <71c3a80a-6a33-7eeb-5eaa-a2ee8599ef55@gutov.dev> References: <00efa4c9-187d-38b3-0da9-4cab39b376ad@gutov.dev> <5fcf9c22-d272-c039-cb2d-9a7c9a2dfb8e@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7033"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: 66646-done@debbugs.gnu.org To: rrudakov@fastmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 21 14:10:06 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 1quAnt-0001eF-00 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 14:10:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quAnh-0005fQ-1P; Sat, 21 Oct 2023 08:09:53 -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 1quAnP-0005cW-R4 for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:09:36 -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 1quAnP-0001q5-Iy for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:09:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quAnr-00010q-A9 for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 08:10:03 -0400 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2023 12:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 66646 X-GNU-PR-Package: emacs Mail-Followup-To: 66646@debbugs.gnu.org, dmitry@gutov.dev, rrudakov@fastmail.com Original-Received: via spool by 66646-done@debbugs.gnu.org id=D66646.16978901693797 (code D ref 66646); Sat, 21 Oct 2023 12:10:03 +0000 Original-Received: (at 66646-done) by debbugs.gnu.org; 21 Oct 2023 12:09:29 +0000 Original-Received: from localhost ([127.0.0.1]:42467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quAnE-0000z6-VX for submit@debbugs.gnu.org; Sat, 21 Oct 2023 08:09:29 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quAn5-0000yf-EY for 66646-done@debbugs.gnu.org; Sat, 21 Oct 2023 08:09:19 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 26C765C013E; Sat, 21 Oct 2023 08:08:42 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 21 Oct 2023 08:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697890122; x=1697976522; bh=Vj0FjL1NMep64tUNE6jXtiE52HWTM82GZD2 k/xa9vJI=; b=izeSFsVV9Ssj6uhpuHxv6SNPVXfZ1Tyl47zFMneXzg2t0fJIzcq +0PkOgVCmBRyFD5F/WrGMACzImn1fFQUlz6bUAXZ3wgZs0nTEYkpo4z45EMoXyMP 1tKukDhoke1dH6osUeJLVEVr4hSrjjI3Xt9V2iIFQA+/RNytE4MtSoYJIiktAOpB +a28QMEVMaWj1DjaCyHe+WtgYFp4RO+hZJH+QBASBhXWG5zymbRRJKpzokuMibvv Zsy/lswGO/eq6IR8cFpxqeDAzil1uXB9ev9g1uh8prI03CjP5x2QF30KMNO/ThXg xN0WkiVbGJu+vNtT7MALKtTRWQqkP7J6jiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697890122; x=1697976522; bh=Vj0FjL1NMep64tUNE6jXtiE52HWTM82GZD2 k/xa9vJI=; b=JfDiq6KU+3D0xyQSFiJGZd8PRhLTTO6sD4UDQCxQwI7wsSYEj8u Ebav+OrVx2Oh2UM5Pjcj/i/XIz98JVLZNJA67zv/OYGpPlF/mjAqAgvvv4NloBsc RZVTK6QlJn1sJq/kRtQZLDIiwXDf9pSMkOIH3UxKoKeF5sXZGcoGoKxkwvoZRVI8 LTyiXs13Bstl3b5mCj3xRXxy6YkBqQwugmtchk81i2spjjfe2s3Cpi4hPJc2oVuD weWymmyRU/MGDZVGcwf+/e6Y3Q5n5Mk/joX6QOuGzONNvMALYAhnnNhia9K/0fVK phZSk+uERtiAhk39ShkAvsrxclouOudNC6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkedtgdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnhephfffheeljeffgeffueeghfekkedtff fgheejvdegjeettdduheeufffggfefjeehnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Oct 2023 08:08:40 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:272880 Archived-At: Version: 29.2 On 21/10/2023 11:18, Roman Rudakov wrote: > > 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. Thanks for checking, pushed to emacs-29.