Skip to content

feat: Add no graphics renderer mode - #489

Merged
epage merged 3 commits into
rust-lang:mainfrom
Muscraft:no-graphics
Oct 16, 2026
Merged

epage merged 3 commits into
rust-lang:mainfrom
Muscraft:no-graphics

Conversation

@Muscraft

@Muscraft Muscraft commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Quoting @estebank in #443:

Introduce a new text only renderer mode. The new output is meant to be less verbose, and usable by users relying on Text-To-Speech and Braille displays. All information that annotate-snippets has available is surfaced, but with an eye at reducing duplicated output and making sure there is no reliance on visuals for highlighting or differentiating necessary information, beyond newlines.

Each individual error group is separated by a single newline. Within an error, each section follows the pattern "LEVEL: message" on one line, followed by the position in the format at PATH:LL:CC, indented by one space. If that position has a Message, its text is on that same line, separated by a colon: at PATH:LL:CC: message. If there are multiple Messages, every subsequent position from the same path skip printing it, we use a more textual format and is indented by one additional space: on line LL, column CC: message. For suggestions, if there are multiple, we render each of them on their own line.

The renderer is color aware, so the same stylesheet is used as regular ASCII and Unicode drawing modes.

This PR is based on the code in #443 but with some tweaks that came from discussions about #443.

A huge thanks to @estebank for all of the help and guidance on this!


🤖 LLM disclosure: Some of the tests in tests/no_graphics.rs were generated by an LLM and then cleaned up by me. There were also various rounds of reviews from LLMs.

Comment thread src/renderer/no_graphics.rs Outdated
Comment thread src/renderer/no_graphics.rs Outdated
Comment thread src/renderer/no_graphics.rs Outdated
Comment thread src/renderer/no_graphics.rs Outdated
Comment thread src/renderer/no_graphics.rs Outdated
Comment thread src/renderer/no_graphics.rs Outdated
Comment thread src/renderer/no_graphics.rs Outdated
Comment thread tests/color/ann_eof.rs Outdated
@epage

epage commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

My focus on the review was for the code. I'm deferring formatting conversations mostly to @Muscraft and @estebank.

Going ahead and merging because formatting can always be iterated on.

@epage
epage merged commit ce0b868 into rust-lang:main Oct 16, 2026
22 checks passed
@Muscraft
Muscraft deleted the no-graphics branch October 16, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants