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

From: Randy Taylor <[email-masked]>
Date: Fri, 22 Nov 2024 03:30:05 +0000

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.

Personally, I envisioned a custom highlight helper function like
rust-ts-mode--fontify-pattern or rust-ts-mode--fontify-scope which
seems like the simplest solution that should cover this use case, but
I'm not actually aware of all the sorts of craziness one could get up
to in a macro invocation so that might not be enough and maybe injections
are the way to go.

> 
> Here is some example code to test it against:
> 
> fn foo() -> i32 {
> 
> 4
> }
> 
> fn main() {
> println!("{:?}", foo());
> }
> 
> 
> Thanks