Subject: Re: bug#59977: 29.0.60; python-ts-mode does not fontify function-invocations using font-lock-function-name [PATCH]

From: Yuan Fu <[email-masked]>
Date: Thu, 15 Dec 2022 17:35:37 -0800

Jostein Kjønigsen <[email-masked]> writes:

> On 12.12.2022 23:54, Yuan Fu wrote:
>> Ah, yes. That’s because the "definition" feature, which is by enabled by
>> default, only highlights definition and ignores invocation. OTOH, the
>> "function" feature highlights every instance of a function identifier,
>> but it isn’t enabled by default.
>
> I've tried latest python-ts-mode from latest emacs-29 branch, with
> fontification set to level 4 and I can still reproduce this error.
>
> Looking at the code, I cannot see any "function" feature defined, and
> to me it seems a patch like the one I added is required to introduce
> this functionality.

Yes, you are exactly right. My point is that the change belongs to
"function" feature and not definition. I made a change that added your
rules to a new "function" feature.

>> Other tree-sitter major modes doesn’t
>> have "definition" and enable "function" by default, I think.
>
> I believe this is standard for js-ts-mode, typescript-ts-mode,
> tsx-ts-mode and csharp-ts-mode. Even on level 3, and if it wasn't, as
> a user of those languages, I would argue in support of having it there
> :)
>
> I can't "speak" on behalf of the other major-modes though.

I’m sure a lot of people would prefer that, no doubt. The other modes
currently having them on level 3 is something we should fix (unless we
end up deciding that we want "function" feature on level 3).

>> I’m planning to standardize the features in each major mode according to
>> the list I showed you earlier. It’d be great if you can have a look at
>> that list and see if you have any opinions, before we decide on the
>> final form of it and start to standardize those features in major modes.
>> (Of course, each language is different, the standard feature list is
>> just a base upon which major modes will extend/modify.)
>>
>> Yuan
> I guess that is another discussion entirely (how to implement a given
> set of features).
>
> This bug is about a feature (function-call highlighting)  being fully
> missing :)

Yes, I understand, I’m not against adding this in any way.

Yuan