annotate-snippets
annotate-snippets
is a Rust library for annotation of programming code slices.
The library helps visualize meta information annotating source code slices.
It takes a data structure called Snippet
on the input and procudes a String
which may look like this:
error[E0308]: mismatched types
--> src/format.rs:52:1
|
51 | ) -> Option<String> {
| -------------- expected `Option<String>` because of return type
52 | / for ann in annotations {
53 | | match (ann.range.0, ann.range.1) {
54 | | (None, None) => continue,
55 | | (Some(start), Some(end)) if start > end_index => continue,
... |
71 | | }
72 | | }
| |_____^ expected enum `std::option::Option`, found ()
Installation
[]
= "0.1.0"
Usage
extern crate annotate_snippets;
use snippet;
Local Development
cargo build
cargo test
When submitting a PR please use cargo fmt
(nightly).