Changelog

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

0.9.2 - 2020-03-29

Changed

  • Render overlapping multiline marks on the same lines of source code.

    For example:

    error[E0308]: match arms have incompatible types
    
       ┌── codespan/src/file.rs:1:9 ───
       │
     1 │ ╭         match line_index.compare(self.last_line_index()) {
     2 │ │             Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
     3 │ │             Ordering::Equal => Ok(self.source_span().end()),
     4 │ │             Ordering::Greater => LineIndexOutOfBoundsError {
     5 │ │                 given: line_index,
     6 │ │                 max: self.last_line_index(),
     7 │ │             },
     8 │ │         }
       │ ╰─────────' `match` arms have incompatible types
       ·
     2 │               Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
       │                                 --------------------------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
     3 │               Ordering::Equal => Ok(self.source_span().end()),
       │                                  ---------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
     4 │               Ordering::Greater => LineIndexOutOfBoundsError {
       │ ╭──────────────────────────────────^
     5 │ │                 given: line_index,
     6 │ │                 max: self.last_line_index(),
     7 │ │             },
       │ ╰─────────────^ expected enum `Result`, found struct `LineIndexOutOfBoundsError`
       │
       = expected type `Result<ByteIndex, LineIndexOutOfBoundsError>`
            found type `LineIndexOutOfBoundsError`
    

    …is now rendered as:

    error[E0308]: match arms have incompatible types
    
       ┌── codespan/src/file.rs:1:9 ───
       │
     1 │   ╭         match line_index.compare(self.last_line_index()) {
     2 │   │             Ordering::Less => Ok(self.line_starts()[line_index.to_usize()]),
       │   │                               --------------------------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
     3 │   │             Ordering::Equal => Ok(self.source_span().end()),
       │   │                                ---------------------------- this is found to be of type `Result<ByteIndex, LineIndexOutOfBoundsError>`
     4 │   │             Ordering::Greater => LineIndexOutOfBoundsError {
       │ ╭─│──────────────────────────────────^
     5 │ │ │                 given: line_index,
     6 │ │ │                 max: self.last_line_index(),
     7 │ │ │             },
       │ ╰─│─────────────^ expected enum `Result`, found struct `LineIndexOutOfBoundsError`
     8 │   │         }
       │   ╰─────────' `match` arms have incompatible types
       │
       = expected type `Result<ByteIndex, LineIndexOutOfBoundsError>`
            found type `LineIndexOutOfBoundsError`
    

0.9.1 - 2020-03-23

Added

  • codespan_reporting::diagnostic::Diagnostic now implements Debug.

Changed

  • Single-line labels are now rendered together, under the same source line.

    For example:

       ┌── one_line.rs:3:5 ───
       │
     3 │     v.push(v.pop().unwrap());
       │     - first borrow later used by call
       ·
     3 │     v.push(v.pop().unwrap());
       │       ---- first mutable borrow occurs here
       ·
     3 │     v.push(v.pop().unwrap());
       │            ^ second mutable borrow occurs here
       │
    

    …is now rendered as:

       ┌── one_line.rs:3:5 ───
       │
     3 │     v.push(v.pop().unwrap());
       │     - first borrow later used by call
       │       ---- first mutable borrow occurs here
       │            ^ second mutable borrow occurs here
       │
    

0.9.0 - 2020-03-11

Added

  • The codespan_reporting::files module was added as a way to decouple codespan_reporting from codespan.
    • codespan_reporting::files::Files allows users to implement custom file databases that work with codespan_reporting. This should make it easier to integrate with libraries like Salsa, and also makes it less invasive to use codespan_reporting on existing projects.
    • codespan_reporting::files::SimpleFile is a simple implementation of codespan_reporting::files::Files where only a single file is needed.
    • codespan_reporting::files::SimpleFiles is a simple implementation of codespan_reporting::files::Files where multiple files are needed.

Changed

  • The codespan_reporting::diagnostic module has been greatly revamped, making the builder API format more nicely with rustfmt, and allowing for multiple primary labels.
  • The output of codespan_reporting::term::emit was improved, with the following changes:
    • labels on consecutive lines no longer render breaks between them
    • source lines are rendered when there is only one line between labels
    • the inner gutter of code snippets is now aligned consistently
    • the outer gutter of consecutive code snippets are now aligned consistently
  • codespan_reporting::term::emit now takes writers as a trait object (rather than using static dispatch) in order to reduce coda bloat and improve compile times.
  • The field names in codespan_reporting::term::Chars were tweaked for consistency.

Removed

  • codespan_reporting no longer depends on codespan. Note that codespan can still be used with codespan_reporting, as codespan::Files now implements codespan_reporting::files::Files.

0.8.0 - 2020-02-24

0.7.0 - 2020-01-06

0.6.0 - 2019-12-18

0.5.0 - 2019-10-02

0.4.1 - 2019-08-25

0.4.0 - 2019-08-22

0.3.0 - 2019-05-01

0.2.1 - 2019-02-26

0.2.0 - 2018-10-11