GNU bug report logs - #61303
29.0.60; rust-ts-mode does not consistently fontify nested macro-invocations

Previous Next

Package: emacs;

Reported by: jostein <at> kjonigsen.net

Date: Sun, 5 Feb 2023 21:16:02 UTC

Severity: normal

Found in version 29.0.60

Full log


View this message in rfc822 format

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: "Theodor Thornhill" <theo <at> thornhill.no>
Cc: Randy Taylor <dev <at> rjt.dev>, Jostein Kjønigsen <jostein <at> kjonigsen.net>, 61303 <at> debbugs.gnu.org
Subject: bug#61303: 29.0.60; rust-ts-mode does not consistently fontify nested macro-invocations
Date: Sun, 05 Feb 2023 23:26:32 +0100
[Message part 1 (text/plain, inline)]
On Sun, Feb 5, 2023, at 23:22, Theodor Thornhill wrote:
> Jostein Kjønigsen <jostein <at> secure.kjonigsen.net> writes:
> 
> > Hey there.
> >
> 
> Hi!
> 
> > Thanks for another tree-sitter based mode to hack at :D
> >
> > I think I've found an error/lacking in rust-ts-mode where we may have to move
> > upstream to fix it.
> >
> > Consider the following contrived (and yes, not very idiomatic) rust-code:
> >
> > let result = format!("{}{}",
> >     "Well yes",
> >     format!("Or {} no?", "possibly"));
> >
> > With rust-ts-mode first format! invocation will get highlighted as a
> > macro-invocation, while the second will not.
> >
> > Inspecting this using treesit-explore-mode, I get the following tree:
> >
> > (let_declaration let pattern: (identifier) =
> >   value:
> >    (macro_invocation macro: (identifier) !
> >     (token_tree (
> >      (string_literal " ")
> >      (string_literal " ")
> >      (identifier)
> >      (token_tree (
> >       (string_literal " ")
> >       (string_literal " ")
> >       ))
> >      )))
> >   ;)
> >
> > Notice the lack of a second/nested "macro_invocation"-node. Instead the second
> > macro is just denoted as a "identifier".
> >
> > To fix this, we'll probably need to upstream some bug-reports and PRs?
> 
> Sounds like it!  Just in case - the code compiles, right?
> 
> Theo
> 

Yes. This is compilable, runnable rust-code. 

—
Jostein
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.