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: Tue, 12 Dec 2023 00:33:44 -0800 Message-ID: References: <13417b56-4849-c7a5-9fd3-f1ff7909e9d4@gutov.dev> <69058ffa-b778-4913-9fa8-f6c5c7d525e0@gmail.com> <9257ecaf-8f4f-20d1-387c-8372c13077dd@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="13538"; 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 Tue Dec 12 09:35:10 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 1rCyEP-0003FA-Et for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Dec 2023 09:35:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCyE5-0004kM-Bg; Tue, 12 Dec 2023 03:34: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 1rCyE3-0004kC-9N for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 03:34:47 -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 1rCyE2-0004pc-Pl for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 03:34:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCyEI-0007uu-0M for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 03:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Dec 2023 08:35: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.170237005030370 (code B ref 67684); Tue, 12 Dec 2023 08:35:01 +0000 Original-Received: (at 67684) by debbugs.gnu.org; 12 Dec 2023 08:34:10 +0000 Original-Received: from localhost ([127.0.0.1]:55232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCyDR-0007tm-QA for submit@debbugs.gnu.org; Tue, 12 Dec 2023 03:34:10 -0500 Original-Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:45267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCyDP-0007tZ-BL for 67684@debbugs.gnu.org; Tue, 12 Dec 2023 03:34:08 -0500 Original-Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1d06fffdb65so30993745ad.2 for <67684@debbugs.gnu.org>; Tue, 12 Dec 2023 00:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702370026; x=1702974826; 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=1CbHckEviS12ZSoLcOs7jKsK+i8yi/NiK1bvat31LpU=; b=A5m6UP+z9IvDkRK0acTV3j14RcHO8ADkUbTxhwWRx9dL8D28ajvC+yrenTPv/MFVNB I0fQIgGyOis3aGqa8gtMSFrbPW8LUMGwQjfOi4pCC1K5GvXo10DGrcFRBT8aJSS3RGSy Ft3ZZFRoxO5i1VcUNlt76nNSdfOXox+vaaZFZVxjfoMY12sfNru1APQ9PuOghDQJj0H7 EMwlqppztOBvXvkITF8km/JBknwnT4xKLeW+lu9FFEwZ9WTQEaGwgPy+N4ThrHgX4s4E qmKDriKdTOeYD8ulmnjmGC6Kq+KvAVLXI2cuSa+q5XeJNWBHXl/ieUbWchAk8vU0DXWQ OaPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702370026; x=1702974826; 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=1CbHckEviS12ZSoLcOs7jKsK+i8yi/NiK1bvat31LpU=; b=t/NsBlz2+yIdF9fUc8onn3ttP+J3bV5RnTh0w7K9fmIfAHSVxD/Y12Px3V38RQcnmt WwV0IMReBAAkoBbKv6BFzmFS/OXyjJBGcgTwekxpH7CXrJWqtl33h7g/qOF2vmaAqiys nEhs7+5cJQQJPcuBtph/v/14LTxmJdHlvh1GiNJLOlIJeyS/8ziXCaLngN3Kf9JASWex SAV700fT0zky38uuemoUZSToiYk3TpnvHonF+YYgV5kcan4mhcLuxE3uQfg4sQpXngE/ 0Wmqkgxr/P2LYWE2BfxMQcZtxVvys9Ts2qasxXFoC8VfXbTANcoDt36pqeQPQ6Ln7Fwj nDCQ== X-Gm-Message-State: AOJu0Yyv03cJ/L6P7NVlixN14VYb5+E4jNCMsJm3H/yNubbGPE1F5vuH rCB93Z+4G9nz4vrq/PhQZtc9MiYbZJu53A== X-Google-Smtp-Source: AGHT+IF6bXH59COxzl6Ljom0hKetbVD8weNQtdI7dolX+0mmYxsamNfXnnrBUltGbxCtvJ0C4qUE/g== X-Received: by 2002:a17:903:41c4:b0:1d0:b24e:165b with SMTP id u4-20020a17090341c400b001d0b24e165bmr2956249ple.129.1702370025881; Tue, 12 Dec 2023 00:33:45 -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 b1-20020a170902d30100b001cf96a0e4e6sm8013104plc.242.2023.12.12.00.33.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Dec 2023 00:33:45 -0800 (PST) Content-Language: en-US In-Reply-To: <9257ecaf-8f4f-20d1-387c-8372c13077dd@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:276023 Archived-At: On 12/11/23 8:35 AM, Dmitry Gutov wrote: > 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. Ah, right. In that case, I don't have anything else to add. Yuan