rust-lang / rust-lang/rust-mode

highlight interpolation in arguments to more macros

Open
#228 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

highlighting
Dominant language
Emacs Lisp
Stars
1.3k
Forks
198
PR merge metrics
No merged PRs in 30d

Description

The new argument interpolation highlighting from #220 handles the macros eprint!, eprintln!, format!, print!, println!, write! and writeln!.

It can be extended to also handle other macros that take format strings. I'm including a list below (I hope I didn't miss any).

  1. First argument can be format string (like eprint!, eprintln!, format!, print!, println!)
    • format_args!
    • panic!
    • unreachable!
    • unimplemented! (not in 1.19.0, but in the beta that is to become 1.20.0)
  2. Second argument can be format string (like write!, writeln!):
    • assert!
    • debug_assert!
  3. Third argument can be format string:
    • assert_eq!
    • assert_ne!
    • debug_assert_eq!
    • debug_assert_ne!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the argument-interpolation highlighting implementation from issue #220 and identify how it recognizes format-string positions. Extend that logic for the listed macros and their first, second, or third arguments, then verify that interpolation is highlighted for each macro named in this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, emacs-lisp, rust
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.