From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
Cc: dev@rjt.dev, jostein@kjonigsen.net, 61303@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:22:18 +0100 [thread overview]
Message-ID: <871qn37nxh.fsf@thornhill.no> (raw)
In-Reply-To: <dc5b36b3-31a7-1c87-3be1-88ad2b3b6dd5@secure.kjonigsen.net> ("Jostein Kjønigsen"'s message of "Sun, 5 Feb 2023 22:08:32 +0100")
Jostein Kjønigsen <jostein@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
next prev parent reply other threads:[~2023-02-05 22:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-05 21:08 bug#61303: 29.0.60; rust-ts-mode does not consistently fontify nested macro-invocations Jostein Kjønigsen
2023-02-05 22:22 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-02-05 22:26 ` Jostein Kjønigsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qn37nxh.fsf@thornhill.no \
--to=bug-gnu-emacs@gnu.org \
--cc=61303@debbugs.gnu.org \
--cc=dev@rjt.dev \
--cc=jostein@kjonigsen.net \
--cc=jostein@secure.kjonigsen.net \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).