https://github.com/vxpm/yumy
diagnostics rendering crate
https://github.com/vxpm/yumy
Last synced: 3 months ago
JSON representation
diagnostics rendering crate
- Host: GitHub
- URL: https://github.com/vxpm/yumy
- Owner: vxpm
- License: apache-2.0
- Created: 2023-07-02T23:43:29.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-07T20:27:39.000Z (almost 2 years ago)
- Last Synced: 2024-08-08T19:54:08.251Z (almost 2 years ago)
- Language: Rust
- Size: 106 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# yumy
a diagnostics rendering crate. yumy aims to be easy to use, focusing on simplicity.
# example output
the diagnostic below is just an example.

here's the same diagnostic printed in compact mode:

and here's the code for this diagnostic (it's a test in this crate!):
```rust, ignore
let src = Source::new(crate::test::RUST_SAMPLE_2, Some("src/main.rs"));
let diagnostic =
Diagnostic::new("error[E0277]: `Rc>` cannot be sent between threads safely".red())
.with_label(Label::styled(
247..260u32,
"required by a bound introduced by this call",
Style::new().yellow()
))
.with_label(Label::styled(
261..357u32,
"`Rc>` cannot be sent between threads safely",
Style::new().red()
))
.with_footnote("note: required because it's used within `{closure@src/main.rs:11:36: 11:43}`".green())
.with_footnote("help: within `{closure@src/main.rs:11:36: 11:43}`, the trait `Send` is not implemented for `Rc>`".blue())
.with_source(src);
diagnostic.eprint(&Config::default()).unwrap();
diagnostic.eprint_compact(&Config::default()).unwrap();
```