Subject: Re: bug#59904: 29.0.60; js-ts-mode does not fontify method-call to object-instances using font-lock-function-name

From: Yuan Fu <[email-masked]>
Date: Fri, 9 Dec 2022 12:53:28 -0800

Theodor Thornhill <[email-masked]> writes:

> Jostein Kjønigsen <[email-masked]> writes:
>
>> Looking into the code, a minimal code-repro looks like this:
>>
>> someObject.someMethod();
>>
>> Activating treesit-explore-mode on that, yields the following tree:
>>
>> (expression_statement
>>   (call_expression
>>    function: (member_expression object: (identifier) . property: 
>> (property_identifier))
>>    arguments: (arguments ( )))
>>   ;)
>>
>> Now looking in js.el I see the following which looks like it's trying to 
>> fontify this, but for some reason it's not working:
>>
>>       (call_expression
>>        function: [(identifier) @font-lock-function-name-face
>>                   (member_expression
>>                    property:
>>                    (property_identifier) @font-lock-function-name-face)])
>>
>> I'm guessing this fontification is being overridden further down (just 
>> like for csharp-ts-mode). From what I can tell, reversing the order of 
>> declarations seems to fix this for me.
>>
>
> Yeah this is probably correct.  Looks good to me.  Yuan, want to apply?
> :-)
>
> Theo

Applied, thanks! I added a comment so we don’t accidentally reintroduce
this later.

Yuan