Subject: Re: bug#75406: 31.0.50; [PATCH] csharp-ts-mode does not highlight type in typeof() expressions

From: Jostein Kjønigsen <[email-masked]>
Date: Sat, 25 Jan 2025 09:55:17 +0100

Hey everyone.

Sorry for the slow response on my part. And thanks for the ping, Eli!

I've been busy at work with some high priority customer-cases, so I haven't had the time to clean up this patch yet. There's also the other csharp-ts-mode bug (75580) which I've been briefly looking into without getting a clear resolution yet.

Since I'm kind of "on the line" for both of those bugs, it might make sense to prioritize this one, as it has a more clear & simple solution, without (as far as I can see) risk of introducing regressions.

I'll see what I can get done this weekend? Crossing fingers! 🫰

—
Kind Regards
Jostein Kjønigsen

> On 25 Jan 2025, at 09:47, Eli Zaretskii <[email-masked]> wrote:
> 
> Ping!  Can we make some progress with this issue?
> 
>> Cc: Theodor Thornhill <[email-masked]>,
>> Jostein Kjønigsen <[email-masked]>,
>> [email-masked]
>> From: Yuan Fu <[email-masked]>
>> Date: Sun, 12 Jan 2025 22:29:00 -0800
>> 
>> 
>> 
>>> On Jan 7, 2025, at 11:23 PM, Jostein Kjønigsen <[email-masked]> wrote:
>>> 
>>> 
>>>> On 8 Jan 2025, at 07:14, Yuan Fu <[email-masked]> wrote:
>>>> Thanks! I suspect that an earlier grammar version used type_of_expression. Can you see if it’s true?
>>> 
>>> 
>>> This seems to be true. This was changed in a commit in May 2024. 
>>> 
>>> https://github.com/tree-sitter/tree-sitter-c-sharp/commit/cd38110b3911979282ad6eeb8cb4d0ecd671b188
>>> 
>>> 
>>> 
>>>> If it is, we should keep the rules for both type_of_expression and typeof_expression, WDYT?
>>> 
>>> 
>>> Compatibility is a good thing, unless it comes at a too big cost. ;)
>> 
>> I can’t agree more, trust me ;-) This one seems ok to me, but it’s your call. 
>> 
>>> 
>>>> On the same note, we could use some utility function that makes it less verbose to test queries and use different query based on the test result.
>>> 
>>> I agree about that. That makes sense. 
>>> 
>>> Is there any precedent for how that is done in other major-modes?
>> 
>> Usually we define a test function that checks the installed grammar accepts a certain query, and use this test to determine what query to use. I’m thinking about adding this utility function to treesit.el to streamline the process, but haven’t decided on what the interface should be.
>> 
>> For some existing example, you can take a look at go-ts-mode--iota-query-supported-p and how it’s used.
>> 
>> Yuan
>> 
>> 
>>