From: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
To: "Theodor Thornhill" <theo@thornhill.no>
Cc: "Randy Taylor" <dev@rjt.dev>,
"Jostein Kjønigsen" <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:26:32 +0100 [thread overview]
Message-ID: <da5f9859-696d-4974-9435-b93996859d15@app.fastmail.com> (raw)
In-Reply-To: <871qn37nxh.fsf@thornhill.no>
[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]
On Sun, Feb 5, 2023, at 23:22, Theodor Thornhill wrote:
> 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
>
Yes. This is compilable, runnable rust-code.
—
Jostein
[-- Attachment #2: Type: text/html, Size: 2641 bytes --]
prev parent reply other threads:[~2023-02-05 22:26 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
2023-02-05 22:26 ` Jostein Kjønigsen [this message]
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=da5f9859-696d-4974-9435-b93996859d15@app.fastmail.com \
--to=jostein@secure.kjonigsen.net \
--cc=61303@debbugs.gnu.org \
--cc=dev@rjt.dev \
--cc=jostein@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).