From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#67684: 30.0.50; Font lock rule conflict in js-ts-mode at level 4 Date: Sun, 10 Dec 2023 17:37:35 -0800 Message-ID: <69058ffa-b778-4913-9fa8-f6c5c7d525e0@gmail.com> References: <13417b56-4849-c7a5-9fd3-f1ff7909e9d4@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="3139"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Dmitry Gutov , =?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 02:39:23 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 1rCVGU-0000fV-TC for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Dec 2023 02:39:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCVFx-0002VJ-D9; Sun, 10 Dec 2023 20:38:49 -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 1rCVFw-0002Ux-8n for bug-gnu-emacs@gnu.org; Sun, 10 Dec 2023 20:38: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 1rCVFv-0007X3-W1 for bug-gnu-emacs@gnu.org; Sun, 10 Dec 2023 20:38:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCVG9-0004lw-Re for bug-gnu-emacs@gnu.org; Sun, 10 Dec 2023 20:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Dec 2023 01:39: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.170225868418270 (code B ref 67684); Mon, 11 Dec 2023 01:39:01 +0000 Original-Received: (at 67684) by debbugs.gnu.org; 11 Dec 2023 01:38:04 +0000 Original-Received: from localhost ([127.0.0.1]:52162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCVFE-0004kc-0e for submit@debbugs.gnu.org; Sun, 10 Dec 2023 20:38:04 -0500 Original-Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]:56351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCVF7-0004k4-Vu for 67684@debbugs.gnu.org; Sun, 10 Dec 2023 20:38:02 -0500 Original-Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3ba04b9b103so699643b6e.0 for <67684@debbugs.gnu.org>; Sun, 10 Dec 2023 17:37:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702258657; x=1702863457; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Aa9g43mJ9tjcj5uacy/58ySH2pmGvRyD5UvLiuYtCn4=; b=iINwbD9r8GGqGKSvvIdUijWW8jZ0yyrvipUsM4SDsRbM2KA3U+4oS3gE+86vqcG9Xg LpXupYFtuohch+lHc5oZo7ISU7jReUBuT4Iak54HgqHbPGMLIQW3QXi4qFGMG6H3rd/g 1Qs8unJ85Jh7UsvF6dFgrsB8azoHhIyrEs68dqkkmrqdhzn4ke8x++lIspfki7pjRek6 6bsCLodgTEXIP4qwgZp/dFyIYxVWWd4pD8eeQo+smtZKuommY2b66hcWlapsuuQNybyq UrsJHLXHBGayQSfAR58CgJZKAbJ/SWpPqCaMBIGWfkSJHZh8nqvVJhYgGNQqq3YtKZbS eaBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702258657; x=1702863457; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Aa9g43mJ9tjcj5uacy/58ySH2pmGvRyD5UvLiuYtCn4=; b=MXXbU4IoT5TtGE8CaWYgYkxb+MpdtKD0WLqAfqivsYsRe7K88hFyieljmQ3JRyIXLs kRyPZgriyTdrv4NdZUKrIu2w9zTAqYU7LYI40a8WMp5kyoopWHhz4Iy+MBkdNy2uQDRV 8gFIWQUmFBpBVJr4IESmhWsC1DIUFtQqVHBICQrzgyzqERVocinQ8sOl1el2fsjawVQp 3TfzYNBugw9CC8OEDMRyJmytclm6XOL7bUR8+gjaBQqFBongL8W8upnTK/0OL0Xav/pT hGXLlklyrAKWmsZHYHSdHddD3lqkhRGDtnhwR6h+/JjhWXriOwzeB3H/AtZk/zKKPqig L1Vg== X-Gm-Message-State: AOJu0Yyc3bFu2jPMIqBcXWXwlfqsgPzlkMSY6jpmAyLDwbhWpcaBkp/c lvFoMo5bWyvitLhRth6KPa4= X-Google-Smtp-Source: AGHT+IFVHl5d5/4Hwszzj5tSLRQneQv7X9f1UTP1AKPPGQ0zpL/rfsk0Rqv9FHnuLu4svQMDoackzQ== X-Received: by 2002:a05:6808:2e95:b0:3ba:587:b349 with SMTP id gt21-20020a0568082e9500b003ba0587b349mr2170529oib.111.1702258657580; Sun, 10 Dec 2023 17:37:37 -0800 (PST) Original-Received: from [192.168.1.7] (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id fm15-20020a056a002f8f00b006ce7ca09d9dsm5157488pfb.153.2023.12.10.17.37.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Dec 2023 17:37:37 -0800 (PST) Content-Language: en-US In-Reply-To: <13417b56-4849-c7a5-9fd3-f1ff7909e9d4@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:275957 Archived-At: 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. Yuan