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#67684: 30.0.50; Font lock rule conflict in js-ts-mode at level 4 Date: Mon, 11 Dec 2023 18:35:06 +0200 Message-ID: <9257ecaf-8f4f-20d1-387c-8372c13077dd@gutov.dev> References: <13417b56-4849-c7a5-9fd3-f1ff7909e9d4@gutov.dev> <69058ffa-b778-4913-9fa8-f6c5c7d525e0@gmail.com> 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="18869"; 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 To: Yuan Fu , =?UTF-8?Q?Lo=C3=AFc_?= =?UTF-8?Q?Lema=C3=AEtre?= , 67684@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 11 17:36:09 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 1rCjGJ-0004d2-UP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Dec 2023 17:36:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCjG4-0005X8-G3; Mon, 11 Dec 2023 11:35:52 -0500 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 1rCjG0-0005Wd-NO for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 11:35:48 -0500 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 1rCjG0-0001io-9h for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 11:35:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCjGD-0000Qy-N6 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 11:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Dec 2023 16:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67684 X-GNU-PR-Package: emacs Original-Received: via spool by 67684-submit@debbugs.gnu.org id=B67684.17023125351625 (code B ref 67684); Mon, 11 Dec 2023 16:36:01 +0000 Original-Received: (at 67684) by debbugs.gnu.org; 11 Dec 2023 16:35:35 +0000 Original-Received: from localhost ([127.0.0.1]:54409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCjFm-0000Q8-Lk for submit@debbugs.gnu.org; Mon, 11 Dec 2023 11:35:35 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCjFi-0000Pn-H1 for 67684@debbugs.gnu.org; Mon, 11 Dec 2023 11:35:34 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1C3815C045C; Mon, 11 Dec 2023 11:35:10 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 11 Dec 2023 11:35:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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=fm3; t= 1702312510; x=1702398910; bh=SU3ItIiy/GGqMK0HuZIz/B3X+mxE4z2CMBB NFBbNvwA=; b=Ulbfj0XADoxefWgnOUvKyP1uGRAgYByNGdqIi61DYPl/POnMybn tP+9MoatXdxilnL772Gzs975TLIiXA+qXBaDmg9oQfYzb9FbETRA8WW75q83SPe5 ItqpWLzsTAJrTNKa5fdxvEV2ocSAh2AhzfAomk2PrK5SjNv/3/GKbuvWJQMHyoeA 68WjxBUOYRVZbSXnNWsdHMyPnHThU1p0zV7rt61afY+ckfvOvqblYv281KphnuDc A86ziGny+3QZZRI6W5VsQd28MNGAjiE1nKdyqucpw0w5766itMDFBoE+l0FD0Nol 6EenQZfxVr/QNKHN3ujR+ul0jsqCBh6H+Ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm1; t=1702312510; x= 1702398910; bh=SU3ItIiy/GGqMK0HuZIz/B3X+mxE4z2CMBBNFBbNvwA=; b=T otEGpAIZ0daFtUkTD3LxP4S3FkcnF97JZQ1+3Q3ER8IO5oeylsELDPZSq8FKO1h2 GD9CJ8rztsJzGWF8Zk185NmNafM8DRc92bwEqt9WNKMeWhiYMyQCH9CTdJv6xDrJ DEHNcZYk7yn+fCIqjiocTUdaUrYHlxVqeuvKdhn76j/kUrJzRsiIzZCldgXPP8Dr Gn0XbSiask+TPdmGUQ/cvFV272/AE0PwjK0/lL6QMQf/yXpy3OCzCvHPJRUrGBBd rOBoPW9foE48O7phRGWKYsvqCo6C+sJdMu9t6OmUNV1qlLxO4hkWPzAPADWANYCE wB4hsp4xoZkh2x5qKn3AA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelvddgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeefjeekvedvfeelfedufeevgeetvdevkeelvddtueetteefudefgfduieekffei leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Dec 2023 11:35:08 -0500 (EST) Content-Language: en-US In-Reply-To: <69058ffa-b778-4913-9fa8-f6c5c7d525e0@gmail.com> 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:275993 Archived-At: On 11/12/2023 03:37, Yuan Fu wrote: > > > On 12/7/23 5:33 PM, Dmitry Gutov wrote: >> Hi! >> >> On 07/12/2023 12:07, Loïc Lemaître wrote: >>> I have noticed a font coloration issue in js-ts-mode when setting the >>> treesit font lock level to 4: JSX attributes color is not the same >>> than at level 3. >>> There should have a conflict between rules for "property_identifier" >>> treesit type. The feature that triggers the conflict is "property" >>> (of the level 4). >>> >>> You can reproduce the issue by following these steps: >>> - M-: (setq treesit-font-lock-level 4) >>> - M-x js-ts-mode on a JSX buffer >>> >>> Note that the bug already exists in Emacs 29.1. >> >> The attached patch seems to fix that. >> >> But it removes a function added by Yuan in e78e69b33189, while >> reshuffling the highlights to reorder priorities. >> >> Yuan, do you remember why you did it that way back then? Perhaps I'm >> missing some other conflict. > For a method invocation like obj.fn(), the "fn" should be fontified in > function-call-face. However, "fn" is a property_identifier in the parse > tree, so it would be fontified in property-use-face by the property > feature. The predicate in the property feature makes sure we skip > properties that are function invocations. And down the line in function > feature, you'll see > > (call_expression >       function: [(identifier) @font-lock-function-call-face >                  (member_expression >                   property: >                   (property_identifier) @font-lock-function-call-face)]) > > Here, the property_identifier is fontified in function-call-face. Thanks. So the patch I sent should also cover this, right? It moves the 'property' feature to below 'function'. And below 'jsx', which fixes the problem reported in this bug.