Skip to content

dukeyico/annotate-snippets-rs

 
 

Repository files navigation

annotate-snippets

annotate-snippets is a Rust library designed to annotate programming code slices, making debugging and diagnostic rendering more intuitive and visually appealing.

crates.io documentation build status

About the Library

The annotate-snippets library provides tools to annotate source code slices with rich, meta information. It generates visually organized, styled error or informational messages, helping developers quickly pinpoint issues in their code.

Key Feature:

It takes a data structure called Snippet on the input and produces a String which may look like this:

Screenshot

Local Development

To build and test the project locally, use the following commands:

cargo build
cargo test

Formatting

Before submitting a pull request (PR), ensure the code follows Rust’s formatting standards by running:

cargo fmt

Contributing

When submitting a PR please use cargo fmt
NOTE:- cargo fmt requires the nightly version of Rust.

Core Concepts:

Annotation: Adding labels or notes to specific parts of code slices for clarity.

Snippet: A small section of programming code to which annotations and diagnostics are applied.

Diagnostic Rendering: Presenting errors or meta information visually for better debugging.

Renderer: A mechanism that transforms the annotated snippets into styled, readable output.

Meta Information: Data that gives additional context or details about a code snippet, like where an error occurred or what caused it.

Feature Parity: Ensuring two tools (or versions of the same tool) have the same capabilities

Error Severity Levels: Categories that describe how bad an error is (e.g., Error, Warning, Info) to help prioritize fixes.

Programming code slices: are small, specific portions or snippets of a larger codebase.

About

Library for snippet annotations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%