Skip to content

Latest commit

 

History

History
360 lines (240 loc) · 16.2 KB

File metadata and controls

360 lines (240 loc) · 16.2 KB

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased - ReleaseDate

0.12.16 - 2026-05-06

Fixed

  • Correctly format suggestion paths when DecorStyle::Unicode #414
  • Correctly highlight multi-line removals that leave only whitespace #413

0.12.15 - 2026-04-06

Fixed

  • Source highlighting no longer misaligns when source contains zero-width or multi-width characters #400

0.12.14 - 2026-04-04

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

0.12.13 - 2026-03-04

Fixed

  • Correctly handle tabs on the first and last lines of multiline Patch #373 and #380

0.12.12 - 2026-02-18

Added

  • Add no_std support #365

0.12.11 - 2026-01-29

Fixed

  • Fix Unicode highlight alignment in patches #357

0.12.10 - 2025-12-01

Fixed

  • Render all removed lines when multiple Patch remove lines #353

0.12.9 - 2025-11-15

Fixes

  • Prefer exact prefix/suffix matches when trimming replacements #345

0.12.8 - 2025-10-28

Fixes

  • No longer panic when annotating leading whitespace #334

0.12.7 - 2025-10-24

Fixes

  • Correctly calculate annotation offsets when trimming unicode characters #331

0.12.6 - 2025-10-22

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

0.12.5 - 2025-10-14

Fixes

  • Highlight the correct span for duplicated diff lines #318

0.12.4 - 2025-09-11

Fixes

  • Removed implicit padding with report starting with secondary title #310

0.12.3 - 2025-09-04

Features

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

Documentation

  • Clarify role of Renderer::<style> methods

0.12.2 - 2025-09-03

Fixes

  • Duplicate multi-line annotations get treated like the are distinct #293
  • Allow passing 0 to Snippet::line_start #294

0.12.1 - 2025-09-02

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

0.12.0 - 2025-08-28

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

0.11.5 - 2024-12-09

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

0.11.4 - 2024-06-15

Fixes

  • Annotations for \r\n are now correctly handled #131

0.11.3 - 2024-06-06

Fixes

  • Dropped MSRV to 1.65

0.11.2 - 2024-04-27

Added

  • All public types now implement Debug #119

0.11.1 - 2024-03-21

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

0.11.0 - 2024-03-15

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

0.10.2 - 2024-02-29

Added

  • Added testing-colors feature to remove platform-specific colors when testing #82

0.10.1 - 2024-01-04

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

0.10.0 - December 12, 2023

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

0.9.2 - October 30, 2023

  • Remove parsing of __ in title strings, fixes (#53)
  • Origin line number is not correct when using a slice with fold: true (#52)

0.9.1 - September 4, 2021

  • 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)

0.9.0 - June 28, 2020

  • Add strip code to the left and right of long lines. (#36)

0.8.0 - April 14, 2020

  • 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)

0.7.0 - March 30, 2020

  • 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.

0.6.1 - July 23, 2019

  • Fix too many anonymized line numbers (#5)

0.6.0 - June 26, 2019

  • Add an option to anonymize line numbers (#3)
  • Transition the crate to rust-lang org.
  • Update the syntax to Rust 2018 idioms. (#4)