Subject: Re: bug#74277: 29.4; rust-ts-mode doesn't highlight some function calls

From: Yuan Fu <[email-masked]>
Date: Sun, 24 Nov 2024 23:34:14 -0800

> On Nov 23, 2024, at 11:17 PM, Trevor Arjeski <[email-masked]> wrote:
> 
> Yuan Fu <[email-masked]> writes:
> 
>>> On Nov 21, 2024, at 7:30 PM, Randy Taylor <[email-masked]> wrote:
>>> 
>>> On Wednesday, November 20th, 2024 at 13:22, Trevor Arjeski <[email-masked]> wrote:
>>>> 
>>>> Trevor Arjeski [email-masked] writes:
>>>> 
>>>> 
>>>> I decided to hack around with this a little bit and found that adding
>>>> the following lines partially works:
>>>> 
>>>> 
>>>> I'm sure there is an issue with solving it this way, I just need someone
>>>> else more experienced to confirm. It is finicky where it turns the
>>>> highlighting on and off when you make some code changes, for example
>>>> adding and removing the semi-colon after the macro invocation.
>>> 
>>> Yuan would be the best to answer that.
>> 
>> Using injection (what Emacs calls local parser, same thing) here is fine, I
>> think. As Randy said, tree-sitter doesn’t have a good answer for macros. If nvim
>> uses this workaround (create an injection for the macro and parses it like
>> normal rust code), then it should be fine for us to follow suit.
>> 
> 
> Any ideas why my crude implementation of the injection "flickers" on and
> off after certain changes?
> 
> Thanks,
> Trevor

So, after spending a night on this, it appears to be a tree-sitter bug :( I created an issue here: https://github.com/tree-sitter/tree-sitter/issues/3962

Yuan