PackageTrack
Sign in Get early access

annotate-snippets

Format diagnostic reports, including highlighting snippets of text

0.12.16 43M downloads/mo #1353 most downloaded on crates.io rust-lang/annotate-snippets-rs

What this package is like to depend on

Last release 3 months ago

06 May 2026

Ships unpredictably

gaps range from 8 days to 9 months

Most releases are documented

notes for 33 of 42 stable releases

Nothing withdrawn

no release was ever pulled

8 years old

42 releases · first in 2018

16 releases in the last 12 months

see the full history below

Release timeline

42 releases · Apr 2018 to May 2026
2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 42
  1. 0.12.16 06 May 2026
    Release notes

    chore: Release annotate-snippets version 0.12.16

    Open source →
    Release notes

    Fixed

    • Correctly format suggestion paths when DecorStyle::Unicode #414
    • Correctly highlight multi-line removals that leave only whitespace #413
    Open source →
  2. 0.12.15 06 Apr 2026
    Release notes

    chore: Release annotate-snippets version 0.12.15

    Open source →
    Release notes

    Fixed

    • Source highlighting no longer misaligns when source contains zero-width or multi-width characters #400
    Open source →
  3. 0.12.14 04 Apr 2026
    Release notes

    chore: Release annotate-snippets version 0.12.14

    Open source →
    Release notes

    Fixed

    • Don't trim middle of spans smaller than padding + margin
    • Properly handle replacement length mismatches
    • Account for "gutter" width when trimming middle of long spans
    • Account for left trim when trimming middle of long spans
    Open source →
  4. 0.12.13 04 Mar 2026
    Release notes

    chore: Release annotate-snippets version 0.12.13

    Open source →
    Release notes

    Fixed

    • Correctly handle tabs on the first and last lines of multiline Patch #373 and #380
    Open source →
  5. 0.12.12 18 Feb 2026
    Release notes

    chore: Release annotate-snippets version 0.12.12

    Open source →
    Release notes

    Added

    • Add no_std support #365

    [0.12.11] - 2026-01-29

    Fixed

    • Fix Unicode highlight alignment in patches #357
    Open source →
  6. 0.12.11 29 Jan 2026
    Release notes

    chore: Release annotate-snippets version 0.12.11

    Open source →
  7. 0.12.10 01 Dec 2025
    Release notes

    chore: Release annotate-snippets version 0.12.10

    Open source →
    Release notes

    Fixed

    • Render all removed lines when multiple Patch remove lines #353
    Open source →
  8. 0.12.9 15 Nov 2025
    Release notes

    chore: Release annotate-snippets version 0.12.9

    Open source →
    Release notes

    Fixes

    • Prefer exact prefix/suffix matches when trimming replacements #345
    Open source →
  9. 0.12.8 28 Oct 2025
    Release notes

    chore: Release annotate-snippets version 0.12.8

    Open source →
    Release notes

    Fixes

    • No longer panic when annotating leading whitespace #334
    Open source →
  10. 0.12.7 24 Oct 2025
    Release notes

    chore: Release annotate-snippets version 0.12.7

    Open source →
    Release notes

    Fixes

    • Correctly calculate annotation offsets when trimming unicode characters #331
    Open source →
  11. 0.12.6 22 Oct 2025
    Release notes

    Changed

    • Upgraded unicode-width to 0.2.2 #326
      • This update adds support for Unicode 16 and 17, and can affect character width calculations
    • Use straight arrows for standalone Origin #327

    Fixes

    • Correctly calculate line numbers for trimmed multi-line suggestions #321
    • Respect .fold(false) when set on suggestions #322
    • Properly calculate the max line number width for suggestions #323
    • Show full line when Patch span points to line end #324
    Open source →
  12. 0.12.5 14 Oct 2025
    Release notes

    Fixes

    • Highlight the correct span for duplicated diff lines #318
    Open source →
  13. 0.12.4 11 Sep 2025
    Release notes

    Fixes

    • Removed implicit padding with report starting with secondary title #310
    Open source →
  14. 0.12.3 04 Sep 2025
    Release notes

    Features

    • Add Title::element for less boilerplate
    • Add renderer::DEFAULT_*_STYLE to expose default styles

    Documentation

    • Clarify role of Renderer::<style> methods
    Open source →
  15. 0.12.2 03 Sep 2025
    Release notes

    Fixes

    • Duplicate multi-line annotations get treated like the are distinct #293
    • Allow passing 0 to Snippet::line_start #294
    Open source →
  16. 0.12.1 02 Sep 2025
    Release notes

    Fixes

    • Correctly calculate line number width when feature simd is enabled #286
    • Close the "code window" when the last line of a Snippet has no annotations and nothing comes after it #288
    Open source →
  17. 0.12.0 28 Aug 2025
    Release notes

    Migration

    Note that the top-level type changed from Message to Report. Message is now a single block of text within a Report.

    • Replace Message::footer with either
      • adding a Message to a Group
      • starting a new Group
    • Replace Level::<Variant> with Level::<VARIANT>, e.g. Level::Error -> Level::ERROR
    • Instead of creating Snippets on a Message (the type returned by Level::title), add them to the Group that is created with the Title
    • Snippet::origin has been renamed to Snippet::path
    • Instead of creating an Annotation from a Level, create them from an AnnotationKind
      • AnnotationKind::Primary will automatically match the Level of the Group
      • All others existing annotations should likely be AnnotationKind::Context
    • Level::title has been replaced with Level::primary_level (for first Group) and Level::secondary_level (subsequent Groups)
    • Message::id has moved to Title::id
    • Renamed Renderer::line_no to Renderer::line_num
    • Add snippet.fold(false) if unspecified, removing snippet.fold(true) if specified

    Features

    • Added unicode decor support, see renderer::DecorStyle
    • Created [Group] to indicate what all is included between the unicode begin and end decor
    • Added Level::secondary_title to allow for custom ANSI escape code styling to be applied to those Titles
    • Added AnnotationKind::Visible to force spans to be visible within a Snippet, despite code folding, without any visible marker
    • Added Origin for referencing code without the source
    • Added Group::with_level to allow Snippets without a Title
    • Added Level::no_name to hide the level name
    • Added Level::with_name to override what is rendered for that level
    • Added Title::id_url to turn Title::id into a link
    • Added Patch for displaying changes to code

    Fixes

    • Switched strings to Cow<str> to allow for easier management of owned data
    • Snippet::path now accepts None
    • Annotation::label now accepts None
    • Various rendering fixes
    Open source →
  18. 0.11.5 09 Dec 2024
    Release notes

    Added

    • rustc's multiline annotation special case #133
      • This special case happens when:
        • The start of a multiline annotation is at the start of the line disregarding any leading whitespace
        • No other multiline annotations overlap it
    • simd feature for faster folding #146

    Changed

    • Multiline annotations with matching spans get merged #133
    • Multiple annotations on one line are no longer rendered on separate lines #133

    Fixed

    • Overlapping multiline annotations are now correctly rendered #133
    • Origin position is now correctly calculated when an annotation starts at the beginning of the line #154
    Open source →
  19. 0.11.4 15 Jun 2024
    Release notes

    Fixes

    • Annotations for \r\n are now correctly handled #131
    Open source →
  20. 0.11.3 06 Jun 2024
    Release notes

    Fixes

    • Dropped MSRV to 1.65
    Open source →
  21. 0.11.2 27 Apr 2024
    Release notes

    Added

    • All public types now implement Debug #119
    Open source →
  22. 0.11.1 21 Mar 2024
    Release notes

    Fixes

    • Switch fold to use rustc's logic: always show first and last line of folded section and detect if its worth folding
    • When folding the start of a source, don't show anything, like we do for the end of the source
    • Render an underline for an empty span on Annotations
    Open source →
  23. 0.11.0 15 Mar 2024
    Release notes

    Breaking Changes

    • Switched from char spans to byte spans #90
    • Renamed AnnotationType to Level #94
    • Renamed SourceAnnotation to Annotation #94
    • Renamed Snippet to Message #94
    • Renamed Slice to Snippet #94
    • Message, Snippet, Annotation and Level can only be built with a builder pattern #91 and #94
    • Annotation labels are now optional #94
    • Annotation now takes in Range<usize> instead of (usize, usize) #90
    • Margin is now an internal detail, only term_width is exposed #105
    • footer was generalized to be a Message #98

    Added

    • term_width was added to Renderer to control the rendering width #105
      • defaults to 140 when not set

    Fixed

    • Margins are now calculated per Snippet, rather than for the entire Message #105
    • Annotations can be created without labels

    Features

    • footer was expanded to allow annotating sources by accepting Message #98
    Open source →
  24. 0.10.2 29 Feb 2024
    Release notes

    Added

    • Added testing-colors feature to remove platform-specific colors when testing #82
    Open source →
  25. 0.10.1 04 Jan 2024
    Release notes

    Fixed

    • Match rustc's colors #73
    • Allow highlighting one past the end of source #74

    Compatibility

    • Set the minimum supported Rust version to 1.73.0 #71
    Open source →
  26. 0.10.0 13 Dec 2023
    Release notes

    Added

    • Renderer is now used for displaying a Snippet #67
      • Renderer also controls the color scheme and formatting of the snippet

    Changed

    • Moved everything in the snippet to be in the crate root #67

    Breaking Changes

    • Renderer now controls the color scheme and formatting of Snippets #67
    • Removed the Style and Stylesheet traits, as color is controlled by Renderer #67
    • Replaced yansi-term with anstyle #67
      • anstyle is designed primarily to exist in public APIs for interoperability
      • anstyle is re-exported under annotate_snippets::renderer
    • Removed the color feature in favor of Renderer::plain() #67
    • Moved Margin to renderer module #67
    • Made the display_list module private #67

    Compatibility

    • Changed the edition to 2021 #61
    • Set the minimum supported Rust version to 1.70.0 #61
    Open source →
  27. 0.9.2 30 Oct 2023
    Release notes
    • Remove parsing of __ in title strings, fixes (#53)
    • Origin line number is not correct when using a slice with fold: true (#52)
    Open source →
  28. 0.9.1 04 Sep 2021
    Release notes
    • Fix character split when strip code. (#37)
    • Fix off by one error in multiline highlighting. (#42)
    • Fix display of annotation for double width characters. (#46)
    Open source →
  29. 0.9.0 28 Jun 2020
    Release notes
    • Add strip code to the left and right of long lines. (#36)
    Open source →
  30. 0.8.0 14 Apr 2020
    Release notes
    • Replace ansi_term with yansi-term for improved performance. (#30)
    • Turn Snippet and Slice to work on borrowed slices, rather than Strings. (#32)
    • Fix \r\n end of lines. (#29)
    Open source →
  31. 0.7.0 30 Mar 2020
    Release notes
    • Refactor API to use fmt::Display (#27)
    • Fix SourceAnnotation range (#27)
    • Fix column numbers (#22)
    • Derive PartialEq for AnnotationType (#19)
    • Update ansi_term to 0.12.
    Open source →
  32. 0.6.1 23 Jul 2019
    Release notes
    • Fix too many anonymized line numbers (#5)
    Open source →
  33. 0.6.0 26 Jun 2019
    Release notes
    • Add an option to anonymize line numbers (#3)
    • Transition the crate to rust-lang org.
    • Update the syntax to Rust 2018 idioms. (#4)

    <!-- next-url --> [Unreleased]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.16...HEAD [0.12.16]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.15...0.12.16 [0.12.15]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.14...0.12.15 [0.12.14]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.13...0.12.14 [0.12.13]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.12...0.12.13 [0.12.12]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.11...0.12.12 [0.12.11]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.10..0.12.11 [0.12.10]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.9...0.12.10 [0.12.9]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.8...0.12.9 [0.12.8]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.7...0.12.8 [0.12.7]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.6...0.12.7 [0.12.6]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.5...0.12.6 [0.12.5]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.4...0.12.5 [0.12.4]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.3...0.12.4 [0.12.3]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.2...0.12.3 [0.12.2]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.1...0.12.2 [0.12.1]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.12.0...0.12.1 [0.12.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.5...0.12.0 [0.11.5]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.4...0.11.5 [0.11.4]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.3...0.11.4 [0.11.3]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.2...0.11.3 [0.11.2]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.1...0.11.2 [0.11.1]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.11.0...0.11.1 [0.11.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.10.2...0.11.0 [0.10.2]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.10.1...0.10.2 [0.10.1]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.10.0...0.10.1 [0.10.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.9.2...0.10.0 [0.9.2]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.9.1...0.9.2 [0.9.1]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.9.0...0.9.1 [0.9.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.8.0...0.9.0 [0.8.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.7.0...0.8.0 [0.7.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.6.1...0.7.0 [0.6.1]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.6.0...0.6.1 [0.6.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.5.0...0.6.0 [0.5.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/0.1.0...0.5.0 [0.1.0]: https://github.com/rust-lang/annotate-snippets-rs/compare/6015d08d7d10151c126c6a70c14f234c0c01b50e...0.1.0

    Open source →
  34. 0.5.0 05 Jan 2019

    Nothing published for this version

  35. 0.1.0 22 May 2018

    Nothing published for this version

  36. 0.0.7 21 May 2018

    Nothing published for this version

  37. 0.0.6 21 May 2018

    Nothing published for this version

  38. 0.0.5 21 May 2018

    Nothing published for this version

  39. 0.0.4 13 May 2018

    Nothing published for this version

  40. 0.0.3 09 May 2018

    Nothing published for this version

  41. 0.0.2 03 May 2018

    Nothing published for this version

  42. 0.0.1 25 Apr 2018

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive