all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: "Yuan Fu" <casouri@gmail.com>,
	"Loïc Lemaître" <loic.lemaitre@gmail.com>,
	67684-done@debbugs.gnu.org
Subject: bug#67684: 30.0.50; Font lock rule conflict in js-ts-mode at level 4
Date: Wed, 13 Dec 2023 00:02:55 +0200	[thread overview]
Message-ID: <32d1b804-2d94-ee16-93fd-c515c70b9bcd@gutov.dev> (raw)
In-Reply-To: <ceeb399b-b2a9-48c7-8e26-bfd964c148d5@gmail.com>

Version: 29.2

On 12/12/2023 10:33, Yuan Fu wrote:
> 
> 
> 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.

Great! I've pushed the patch to emacs-29, and this bug is now closed.





      reply	other threads:[~2023-12-12 22:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 10:07 bug#67684: 30.0.50; Font lock rule conflict in js-ts-mode at level 4 Loïc Lemaître
2023-12-08  1:33 ` Dmitry Gutov
2023-12-08 11:16   ` Loïc Lemaître
2023-12-11  1:37   ` Yuan Fu
2023-12-11 16:35     ` Dmitry Gutov
2023-12-12  8:33       ` Yuan Fu
2023-12-12 22:02         ` Dmitry Gutov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32d1b804-2d94-ee16-93fd-c515c70b9bcd@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=67684-done@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=loic.lemaitre@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.