-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
C-bugCategory: bugCategory: bug
Description
#!/usr/bin/env nargo
---
[dependencies]
annotate-snippets.git = "https://github.com/rust-lang/annotate-snippets-rs.git"
---
use annotate_snippets::{renderer::OutputTheme, AnnotationKind, Group, Level, Renderer, Snippet};
fn main() {
// Taken from: https://docs.python.org/3/library/typing.html#annotating-callable-objects
let source = "def __call__(self, *vals: bytes, maxlen: int | None = None) -> list[bytes]: ...";
let group = Group::with_title(Level::ERROR.title("")).element(
Snippet::source(source).annotation(AnnotationKind::Primary.span(4..12).label("annotation")),
);
println!(
"{}",
Renderer::styled()
.theme(OutputTheme::Unicode)
.term_width(83)
.render(&[group])
);
}
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bug