Skip to content

Latest commit

 

History

History
1064 lines (692 loc) · 55.7 KB

CHANGELOG.md

File metadata and controls

1064 lines (692 loc) · 55.7 KB

miette Release Changelog

7.4.0 (2024-11-27)

Features

  • graphical: Inherit source code to causes (#401) (465e6b6a)
  • report: Implement WrapError for Option (#409) (7fae60fd)

7.3.0 (2024-11-26)

Features

  • SourceSpan: add impl From (#385) (73da45b6)
  • Report: add from_err() method to Report (#403) (93d3bd11)
  • Diagnostic: Implement Diagnostic for Infallible (#402) (f3fb4c1e)

Performance

  • handlers: optimize string-buffer reallocations (#387) (b8dfcda4)

Bug Fixes

  • graphical: fix nested error wrapping (#358) (3eabbceb)
  • docs: updated example image (fixes #111) (#270) (7b42b12c)
  • clippy: Fix clippy lints in docs (#365) (ea4296da)
  • docs: alt attribut for single-line-example.png (#372) (b82cc81b)
  • color: setting NO_COLOR should not print ansi codes for non-terminals (#381) (813232ba)
  • clippy: fix Rust v1.78.0 clippy warnings (#382) (e1026f75)
  • perf: mark error constructors cold (#378) (9bbcf3c6)
  • handlers: Disable textwrap::smawk feature (#379) (edfdcb52)
  • graphical: Format entire link instead of just name (#389) (bf5aa374)
  • clippy: fix clippy::doc_lazy_continuation lints (#395) (15beec43)
  • graphical: Handle invalid UTF-8 in source code (#393) (d6b45585)
  • features: Use dep: syntax for dependencies in features. (#394) (789a04e3)
  • clippy: Fix needless_return lint. (#405) (5f441d01)

Documentation

  • examples: add serde_json integration example (#407) (2902a233)

7.2.0 (2024-03-07)

Features

  • wasm: add feature "fancy-no-syscall" for wasm targets (#349) (328bf379)

Bug Fixes

  • label-collections: Label collection fixes and cleanup (#343) (75fea093)
  • invalid span: skip the snippet when read_span fails (#347) (7d9dfc6e)
  • redundant-import: fix a warning and CI failure in nightly (#348) (6ea86a22)

7.1.0 (2024-02-16)

Features

  • derive: enable more boxed types to be #[diagnostic_source] (#338) (c2f06f6c)
  • source: derive common traits for NamedSource, SourceSpan, and SourceOffset (#340) (6f09250c)
  • collection: add support for collection of labels (#341) (03060245)

Bug Fixes

  • tests: revert test-breaking changes of e5c7ae4 (#339) (6e829f8c)

7.0.0 (2024-02-05)

This is a small breaking release on the heels of 6.0 because I neglected to bump owo-colors. I figured it's a good time to do it, before 6.0 gets more widely used.

Features

  • fancy: Add option to change the link display text (#335) (c7144ee5)
  • deps: bump dependencies (a4011d17)
    • BREAKING CHANGE: This bumps owo-colors to 4.0, which is a breaking change because we expose its styles as part of the graphical renderer API

6.0.1 (2024-02-04)

Bug Fixes

  • graphical: oops. Fix theme issue (8b46679c)
  • fmt: remove nightly-only fmt flags (1fa7f524)
  • highlighter: ugh, missed another spot (ab7c066e)

6.0.0 (2024-02-04)

The long-awaited 6.0 release of miette is here, with TONS of goodies, not least of which is syntax highlighting support!

It also comes with a few breaking changes so make sure to check below and update your code as needed!

Features

  • labels: Add support for primary label in specifying line/col information (#291) (db0b7e40)
  • derive: Allow optional sources in derive (#301) (88d00e0e)
  • derive: Make miette-derive be able to be turned off (#304) (c7ba5b7e)
  • graphical: Expose additional textwrap options (#321) (fd77257c)
  • graphical: support rendering labels that contain newlines (#318) (865d67c8)
  • graphical: Add wrap_lines: bool option allowing wrapping be disabled entirely (#328) (b0744462)
  • graphical: render disjoint snippets separately for cleaner output (#324) (19c22143)
  • deps: Bump terminal-size to v0.3.0 (#308) (c0a298e5)
    • BREAKING CHANGE: This requires an MSRV bump to 1.70.0.
  • source-code: Don't override provided source code (#300) (0d5c2ce7)
    • BREAKING CHANGE: Source code is no longer overridden if it was provided by the diagnostic's own source_code() impl.
  • source: use usize for length (#265) (fad0e76a)
    • BREAKING CHANGE: This changes SourceSpan's length type to usize.
  • source: Allow inner source type of a NamedSource to be borrowed (#254) (1df3b1a5)
    • BREAKING CHANGE: This makes the NamedSource type generic over its Source type, instead of boxing it.
  • highlighting: add syntax highlighting support with syntect crate (#313) (e65d0a78)
  • deps: remove is-terminal dep in favor of std::io::IsTerminal (e5c7ae46)
  • deps: remove once_cell dep in favor of std::sync::OnceLock (4c48584f)
    • BREAKING CHANGE: This requires an MSRV bump to 1.70.0.
  • deps: bump some semver-breaking deps to newer versions (29d000f2)
  • MSRV: Actually bump the MSRV to 1.70.0 (ab59a7bc)

Bug Fixes

  • misc: Improve ci and fix clippy (#290) (cc81382a)
  • tests: Fix cargo test with default features. (#294) (1f448e47)
  • clippy: Add missing semicolons where nothing is returned. (#293) (06b34823)
  • graphical: Extend error text span to whole code points (#312) (a8b4ae01)
  • formatting: Fix formatting bug when an empty span is not aligned to a char boundary (#314) (3d6f903d)
  • docs: add example to README and docs fixing #96 (#319) (251d6d59)
  • graphical: rendering bug on small spans in large spans (#316) (7ff4f874)
  • graphical: render cause chains for inner errors (#330) (cb2ae2e1)
  • handler: remove the two extra is_terminal sys call from MietteHandlerOpts::build (#325) (f1dc89c0)

Documentation

  • README: Move import of NamedResult to where it is used (#309) (d37ada87)

5.10.0 (2023-07-16)

Features

  • protocol: add StdError impl for Box<dyn Diagnostic + Send + Sync> (#273) (2e3e5c9d)

5.9.0 (2023-05-18)

Features

  • serde: Add serde support (#264) (c25676cb)
  • const: Constify various functions (#263) (46adb3bc)
  • nested: Render inner diagnostics (#170) (aefe3237)

Bug Fixes

  • misc: Correct some typos (#255) (675f3411)

5.8.0 (2023-04-18)

Features

  • source: Add getter for NamedSource name (#252) (be3b2547)

Bug Fixes

  • narrated: put URLs in their own line (adbff65e)

5.7.0 (2023-04-01)

While this is a semver-minor release, there's potential for it to have knock-on effects due to the syn2 upgrade. There's been issues as this new version propagates between syn/thiserror versions (for example, see a similar change in eyre).

The other thing of note is that backtrace printing is now much better! Try the hook and see for yourself!

Features

  • deps: update to syn2 (#247) (a2157205)
  • panic: improved backtrace handling (b0453215)

Bug Fixes

  • colors: change unicode to default to ansi (#249) (159f2b35)
  • tests: disable doctest that doesn't work with default feature flags (#248) (0b445dc2)

5.6.0 (2023-03-14)

Bug Fixes

  • ci: configure clippy-specific MSRV (b658fc02)
  • graphical: Fix wrong severity of related errors (#234) (3497508a)
  • atty: Switch out atty for is-terminal (#229) (443d240f)

Features

  • protocol: implement Ord for Severity (#240) (ed486c95)

5.5.0 (2022-11-24)

Features

  • SourceCode: Implement SourceCode for Vec (#216) (c857595e)

Bug Fixes

  • derive: elide lifetimes in derived functions (#226) (c88f0b5a)
  • graphical: Fix panic with span extending past end of line (#221) (8b56d277)
  • license: fix mangled license text to improve recognition (d5fbb340)

5.4.1 (2022-10-28)

Bug Fixes

  • graphical: Fix panic with zero-width span at end of line (#204) (b8810ee3)

5.4.0 (2022-10-25)

Features

  • version: declare minimum supported rust version at 1.56.0 (#209) (ac02a124)
  • report: Report::new_boxed (0660d2f4)
  • error: impl AsRef<dyn StdError> for Report (1a27033d)

Bug Fixes

  • wrapper: complete forwarding Diagnostic implementations (3fc5c04c)

5.3.1 (2022-09-10)

Bug Fixes

  • miri: Resolve Miri's concerns around unsafe code (#197) (5f3429b0)
  • graphical: Align highlights correctly with wide unicode characters and tabs (#202) (196c09ce)

5.3.0 (2022-08-10)

Bug Fixes

  • utils: Fix off-by-one error in SourceOffset::from_location (#190) (c3e6c983)

Features

  • graphical: Allow miette users to opt-out of the rendering of the cause chain (#192) (b9ea5871)

5.2.0 (2022-07-31)

Features

  • json: causes support (#188) (c95f58c8)

Bug Fixes

  • docs: readme was getting cut off during generation (e286c705)

5.1.1 (2022-07-09)

Bug Fixes

  • deps: bump minimum supports-color version (#182) (ccf1b8ad)
  • graphical: handle an empty source (#183) (12dc4007)

5.1.0 (2022-06-25)

Features

  • protocol: Implement SourceCode for Arc (and similar types) (#181) (85da6a84)

5.0.0 (2022-06-24)

Breaking Changes

  • theme: restructure automatic color selection (#177) (1816b06a)
    • The default theme now prefers ANSI colors, even if RGB is supported
    • MietteHandlerOpts::ansi_colors is removed
    • MietteHandlerOpts::rgb_color now takes an enum that controls the color format used when color support is enabled, and has no effect otherwise.

Bug Fixes

  • json: Don't escape single-quotes, that's not valid json (#180) (b193d3c0)

4.7.1 (2022-05-13)

Bug Fixes

  • tests: add Display impl to diagnostic_source example (0a4cf4ad)

4.7.0 (2022-05-05)

Features

  • diagnostic_source: add protocol method for Diagnostic-aware source chaining (#165) (bc449c84)

Documentation

  • IntoDiagnostic: Warn of potential data loss (#161) (2451ad6a)

4.6.0 (2022-04-23)

Features

  • spans: add From shorthand for zero-length SourceSpans (1e1d6152)
  • related: print related prefixes according to severity (#158) (084ed138)

Bug Fixes

  • graphical: fix issue with duplicate labels when span len is 0 (#159) (1a36fa7e)

4.5.0 (2022-04-18)

Features

  • spans: make SourceSpan implement Copy (#151) (5e54b29a)
  • help: update macro to allow optional help text (#152) (45093c2f)
  • labels: allow optional labels in derive macro (#153) (23ee3642)
  • help: allow non-option values in #[help] fields (ea55f458)
  • label: use macro magic instead of optional flag for optional labels (9da62cd0)

Bug Fixes

  • theme: set correct field in MietteHandlerOpts::ansi_colors (#150) (97197601)

4.4.0 (2022-04-04)

Features

  • report: Add conversion from Report to Box (#149) (b4a9d4cd)

Bug Fixes

  • docsrs: use proper module names for docsrs URLs (a0b972f8)
  • clippy: misc clippy fixes (b98b0982)
  • fmt: cargo fmt (37cda4a3)

4.3.0 (2022-03-27)

Features

  • reporter: Allow GraphicalReportHandler to disable url display (#137) (b6a6cc9e)

Bug Fixes

  • colors: handler_opts.color(false) should disable color (#133) (209275d4)
  • handler: Apply MietteHandlerOpts::graphical_theme (#138) (70e84f9a)

Documentation

  • readme: Fix a couple links (#141) (126ffc58)

Miscellaneous Tasks

  • deps: Update textwrap to 0.15.0 (#143) (2d0054b3)

4.2.1 (2022-02-25)

Bug Fixes

  • handlers: source code propagation for JSON handler (#122) (50bcec90)
  • clippy: 1.59.0 clippy fix (fa5b5fee)
  • docs: Docs overhaul (#124) (5d23c0d6)

4.2.0 (2022-02-22)

Features

  • derive: allow Report in related (#121) (75d4505e)

4.1.0 (2022-02-20)

.with_source_code() is here!!

Features

  • report: add with_source_code (50519264)
  • handlers: propagate source code to related errors (3a17fcea)

Bug Fixes

  • derive: absolute path references to Diagnostic (#118) (6eb3d2d8)

4.0.1 (2022-02-18)

Bug Fixes

  • graphical: boolean was messing up graphical display (5c085b39)

4.0.0 (2022-02-18)

Breaking Changes

  • colors: treat no-color mode as no-color instead of narratable (#94) (9dcce5f1)
    • BREAKING CHANGE: NO_COLOR no longer triggers the narrated handler. Use NO_GRAPHICS instead.
  • derive: Make derive macro diagnostic attribute more flexible. (#115) (5b8b5478)
    • BREAKING CHANGE: diagnostic attribute duplication will now error.

Features

  • Report: adds .context() method to the Report (#109) (2649fd27)

Bug Fixes

  • handlers: Fix label position (#107) (f158f4e3)

3.3.0 (2022-01-08)

Features

  • deps: Bump owo-colors to 3.0.0 (fe77d8c7)
  • handlers: Add JSON handler (#90) (53b24682)

Bug Fixes

  • chain: correct Chain structure exported (#102) (52e5ec80)
  • json: proper escapes for JSON strings (#101) (645ef6a1)
  • deps: switch to terminal_size (51146535)

3.2.0 (2021-10-06)

Features

  • tabs: Add replace tabs with spaces option (#82) (1f70140c)

Bug Fixes

  • read_span prevent multiline MietteSpanContents from skipping lines (#81) (cb5a919d)

3.1.0 (2021-10-01)

Features

  • SourceSpan: add impl From (#78) (0169fe20)

3.0.1 (2021-09-26)

No code changes this release. Just improved documentation and related tests.

3.0.0 (2021-09-22)

It's here! Have fun!

It's a pretty significant change, so if you were using miette's snippet support previously, you'll need to update your code.

Bug Fixes

  • report: miscellaneous, hacky tweaks to graphical rendering (80036781)
  • protocol: implement source/cause for Box (c3505fac)
  • derive: Code is no longer required (92a31509)
  • graphical: stop rendering red vbars before the last item (e2e4027f)
  • graphical: fix coalescing adjacent things when they cross boundaries (18e0ed77)
  • context: get labels/snippets working when using .context() (41cb710a)
  • api: put panic handler properly behind a flag (55ca8e0b)
  • deps: We do not use ci_info directly anymore (8d1170e2)
  • graphical: Fix off-by-one span_applies calculation (#70) (a6902042)
  • theme: remove code styling (ce0dea54)
  • graphical: render URLs even without a code (77c5899b)
  • deps: remove dep on itertools (612967d3)

Features

  • report: make a single big MietteHandler that can switch modes (4c2463f9)
    • BREAKING CHANGE: linkification option method on GraphicalReportHandler has been changed to .with_links(bool)
  • deps: move fancy reporter (and its deps) to a feature (247e8f8b)
    • BREAKING CHANGE: The default fancy reporter is no longer available unless you enable the "fancy" feature. This also means you will not be pulling in a bunch of deps if you are using miette for a library
  • footer: add footer support to graphical and narrated (93374173)
  • theme: rename some theme items for clarity (c5c0576e)
    • BREAKING CHANGE: These were part of the public API, so if you were using theming, this might have broken for you
  • theme: more styling changes (2c437403)
  • report: add debug report as default, instead of narrated one (9841d6fd)
  • labels: replace snippet stuff with simpler labels (#62) (f87b158b)
  • protocol: Make SourceCode Send+Sync (9aa8ff0d)
  • handlers: Update graphical handler to use new label protocol (#66) (4bb9d121)
  • report: nicer, non-overlapping same-line highlights (1a0f359e)
  • panic: Add basic panic handler and installation function (c6daee7b)
  • panic: add backtrace support to panic handler and move set_panic_hook into fancy features (858ac169)
  • graphical: simplify graphical header and remove a dep (6c648463)
  • related: Add related diagnostics (#68) (8e11baab)
  • graphical: compact graphical display a bit (db637a36)
  • graphical: compact even more (72c0bb9e)
  • graphical: add theming customization for linums (717f8e3d)
  • handler: context lines config support (b33084bd)
  • narrated: updated narrated handler (fbf6664e)
  • narrated: global footer and related diagnostics support (3213fa61)

3.0.0-beta.0 (2021-09-22)

Time to get ready for release!

Bug Fixes

  • graphical: stop rendering red vbars before the last item (dc2635e1)
  • graphical: fix coalescing adjacent things when they cross boundaries (491ce7c0)
  • context: get labels/snippets working when using .context() (e0296578)

Features

  • report: nicer, non-overlapping same-line highlights (338c885a)
  • panic: Add basic panic handler and installation function (11a708a2)
  • panic: add backtrace support to panic handler and move set_panic_hook into fancy features (183ecb9b)
  • graphical: simplify graphical header and remove a dep (9f36a4c2)
  • related: Add related diagnostics (#68) (25e434a2)
  • graphical: compact graphical display a bit (9d07dc5a)
  • graphical: compact even more (712e75fd)

3.0.0-alpha.0 (2021-09-20)

This is the first WIP alpha release of miette 3.0!

It's a MAJOR rewrite of the entire snippet definition and rendering system, and you can expect even more changes before 3.0 goes live.

In the meantime, there's this. :)

Bug Fixes

  • report: miscellaneous, hacky tweaks to graphical rendering (8029f9c6)
  • protocol: implement source/cause for Box (3e8a27e2)
  • derive: Code is no longer required (8a0f71e6)

Features

  • report: make a single big MietteHandler that can switch modes (3d74a500)
    • BREAKING CHANGE: linkification option method on GraphicalReportHandler has been changed to .with_links(bool)
  • deps: move fancy reporter (and its deps) to a feature (bc495e6e)
    • BREAKING CHANGE: The default fancy reporter is no longer available unless you enable the "fancy" feature. This also means you will not be pulling in a bunch of deps if you are using miette for a library
  • footer: add footer support to graphical and narrated (412436cd)
  • theme: rename some theme items for clarity (12a9235b)
    • BREAKING CHANGE: These were part of the public API, so if you were using theming, this might have broken for you
  • theme: more styling changes (9901030e)
  • report: add debug report as default, instead of narrated one (eb1b7222)
  • labels: replace snippet stuff with simpler labels (#62) (0ef2853f)
  • protocol: Make SourceCode Send+Sync (eb485658)
  • handlers: Update graphical handler to use new label protocol (#66) (6cd44a86)

2.2.0 (2021-09-14)

So it turns out 3.0.0 is already under way, if you didn't already hear!

It's going to be an exciting release, but we'll still be putting out bugfixes and (backwards-compatible) features in the 2.x line until that's ready.

And there's definitely stuff in this one to be excited about! Not least of all the ability to forward diagnostic metadata when wrapping other Diagnostics. Huge thanks to @cormacrelf for that one!

We've also got some nice improvements to reporter formatting that should make output look at least a little nicer--most notably, we now wrap messages and footers along the appropriate column so formatting keeps looking good even when you use newlines!

Finally, huge thanks to @icewind1991 for fixing a really weird-looking bug caused by an off-by-one error. Oopsies 😅

Features

  • report: wrap multiline messages to keep formatting (f482dcec)
  • report: take terminal width into account for wrapping text (bc725324)
  • report: make header line as wide as terminal (eaebde92)
  • derive: Add #[diagnostic(forward(field_name), code(...))] (#41) (2fa5551c)

Bug Fixes

  • report: get rid of the weird arrow thing. it does not look good (1ba3f2f5)
  • report: fix wrapping for header and add wrapping for footer (eb07d5bd)
  • report: Fix end of previous line wrongly being included in highlight (#52) (d994add9)

2.1.2 (2021-09-10)

So it turns out I forgot to make snippets and other stuff forward through when you use .context() &co. This should be fixed now 😅

Bug Fixes

  • context: pass on diagnostic metadata when wrapping with Report (e4fdac38)

2.1.1 (2021-09-09)

This is a small, but visually-noticeable bug fix. I spent some time playing with colors and styling and made some fixes that will improve where people's eyes are drawn to, and also take into account color visibility issues a bit more.

Bug Fixes

  • report: don't color error message text to draw eyes back to it (6422f821)
  • reporter: improve color situation and style things a little nicer (533ff5f3)

2.1.0 (2021-09-08)

This is a small release with a handful of quality of life improvements (and a small bugfix).

Features

  • printer: use uparrow for empty highlights and fix 0-offset display bug (824cd8be)
  • derive: make #[diagnostic] optional for enums, too (ffe1b558)

2.0.0 (2021-09-05)

This release overhauls the toplevel/main experience for miette. It adds a new Report type based on eyre::Report and overhauls various types to fit into this model, as well as prepare for some future changes in Rust that will make it possible to integrate miette directly with crates like eyre instead of having to use this specific Report.

On top of that, it includes a couple of nice new features, such as #[diagnostic(transparent)], which should be super useful when wrapping other diagnostics with your own types!

Breaking Changes

  • report: anyhow-ify DiagnosticReport (#35) (3f9da04b)
    • DiagnosticReport is now just Report, and is a different, eyre::Report-like type.
    • DiagnosticResult is now just Result.
    • .into_diagnostic() now just transforms the error into a Report.
    • DiagnosticReportPrinter has been replaced with ReportHandler
    • set_printer has been replaced by set_hook
    • code is now optional.
    • .into_diagnostic() no longer takes a code argument.
    • #[diagnostic] is now optional when deriving Diagnostic.

Features

  • derive: Add #[diagnostic(transparent,forward)] (#36) (53f5d6d1)
  • Source: impl Source for str, &str (make &'static str usable for testing) (#40) (50c7a883)
  • source: Remove bound T: Clone from Source implementation for Cow. (#42) (0427c9f9)

Bug Fixes

  • reporter: Only inc the line count if we haven't already done so with '\n' or '\r\n' (#37) (5a474370)
  • printer: Show snippet message for unnamed sources (#39) (84219f6c)

1.1.0 (2021-08-29)

This is a small release of patches entirely not my own!

The exciting new feature is the ability to do thiserror-style #[diagnostic(transparent)] when using the derive macro, which will defer diagnostics to a Diagnostic referred to by the struct/enum!

Big thanks to @cormacrelf and @felipesere for your contributions!

Features

  • derive: Add #[diagnostic(transparent,forward)] (#36) (53f5d6d1)

Bug Fixes

  • reporter: Only inc the line count if we haven't already done so with '\n' or '\r\n' (#37) (5a474370)

1.0.1 (2021-08-23)

This is a (literally) small release. I noticed that the crate's size had increased significantly before I realized cargo was including the images/ folder. This is not needed, as these images are just hosted on GitHub.

miette should be smaller now, I hope :)

Bug Fixes

  • crate: reduce crate size by removing images (5f74da67)

1.0.0 (2021-08-23)

...you know what? I'm just gonna tag 1.0.0, because I don't want sub-1.0 versions anymore, but the Cargo ecosystem buries pre-releases pretty thoroughly. Integers are cheap!

So here we are! We made it to 1.0, and with some really nice goodies to boot.

Most fun is the fact that the default printer now has clickabble url linking support. A new Diagnostic::url() method has been added to the protocol that, is used to figure out what URL to send folks to! This should work on most "modern" terminals, but more thorough support checking will be done in the future. And of course, the narrated reporter prints them out too.

I also took the time to completely redo how messages, labels, and filenames are handled in the system, and this is a pretty big change you might run into. Godspeed!

Last but not least, we got our first external contribution! Thank you to @martica for the bug fix!

Anyway, here's to 1.0, and to many more after that. Enjoy! :)

Breaking Changes

  • snippets: Overhauled how snippets handle labels, sources, and messages, including the derive macro (61283e9e

Features

  • links: added URL linking support and automatic docs.rs link generation (7e76e2de)
  • theme: Add an initial rgb style with nicer colors (3546dcec) - @martica

Bug Fixes

  • printer: clamp highlight length to at least 1 (#32) (9d601599)

1.0.0-beta.1 (2021-08-22)

It's happening, folks! miette is now working towards stability and is now in beta! We'll keep it like this for a little while until a few more people have tried it out and given feedback. New features may still be added, and breaking changes may still happen, but miette is now considered "good enough to use", and breaking changes are expected to be more rare.

Oh, and as part of this release, the docs were overhauled, particularly the README, so you might want to take a gander at them!

Breaking Changes

  • printer: rename default printer and consistify some naming conventions with printing (aafa4a3d, breaks #)
  • into_diagnostic: .into_diagnostic() is now generic across any impl fmt::Display instead of expecting a dyn (c1da4a0d)

Features

  • error: diagnostic-ify MietteError (e980b723)

Bug Fixes

  • derive: #[diagnosic(severity)] works for named and unnamed variants/structs now (adf0bc93)
  • protocol: oops, missed a spot after a rename (5c077d30)

0.13.0 (2021-08-21)

This release includes some accessibility improvements: miette now includes a "narratable" printer that formats diagnostics like this:

Error: Received some bad JSON from the source. Unable to parse.
    Caused by: missing field `foo` at line 1 column 1700

Begin snippet for https://api.nuget.org/v3/registration5-gz-semver2/json.net/index.json starting
at line 1, column 1659

snippet line 1: gs":["json"],"title":"","version":"1.0.0"},"packageContent":"https://api.nuget.o
    highlight starting at line 1, column 1699: last parsing location

diagnostic help: This is a bug. It might be in ruget, or it might be in the source you're using,
but it's definitely a bug and should be reported.
diagnostic error code: ruget::api::bad_json

This style is the default in a number of situations:

  1. The NO_COLOR env var is present and set, and not 0.
  2. The CLICOLOR env var is present and not set to 1.
  3. stdout or stderr are not TTYs.
  4. A CI environment is detected.

You can override and customize this behavior any way you want by using the miette::set_reporter() function at the toplevel of your application, but we encourage you to at least make the narratable printer an option for your users, since miette's default printer is exceptionally bad for screen readers.

Our hope is that this release is only the starting point towards making miette's error reporting not just really fancy and cool, but friendly and accessible to everyone.

Features

  • printer: added (and hooked up) an accessible report printer (5369a942)

0.12.0 (2021-08-21)

This is a SUPER EXCITING release! With this, miette now has a full-featured pretty-printer that can handle cause chains, snippets, help text, and lots more!

Check out the serde_json example to see a "real-world" case!

This release also adds support for full thiserror-style format strings to the help() diagnostic derive attribute!

We're rapidly approaching a 1.0-beta release. One more extra-fun treat left and we can start stabilizing!

Features

  • derive: format string support for help() (8fbad1b1)
  • printer: lots of small improvements to printer (5fbcd530)
  • reporter: fancy new reporter with unicode, colors, and multiline (#23) (d675334e)

0.11.0 (2021-08-18)

BIG changes this time. The whole end-to-end experience for tossing around Diagnostics in your code has been overhauled, printing reports is easier than ever, and we even have an eyre::Report-style wrapper you can pass around in app-internal returns!

Features

  • reporter: Overhauled return type/main/DiagnosticReport experience. (29c1403e)

0.10.0 (2021-08-17)

Lots of goodies in this release! I'm working hard on the 1.0.0 Roadmap, so things are changing pretty quick, and I thought it would be nice to release this checkpoint.

Bug Fixes

  • protocol: keep the owned spans (49151bb0)

Features/Breaking Changes

  • derive: Allow anything Clone + Into to be used as a Span (385171eb)
  • offsets:
    • nice utility function to get an offset from a Rust callsite (26f409c5)
    • utility function for converting from line/col to offset (75c23127)
    • more utility From impls for SourceSpan (95200366)
  • protocol:
    • add Source impls for Cow and Arc (53074d34)
    • reference-based DiagnosticReport! (f390520b)

0.9.0 (2021-08-17)

Yay new version already! A pretty significant API change, too! ��

Breaking Changes

SourceSpans have changed a bit: for one, they're based on offset/length now, instead of start/end. For two, they have a new Option<String> field, label, which is meant to be used by reporters in different contexts. For example, highlight snippets will use them as the labels for underlined sections of code, while the snippet context will use the label as the "file name" for the Source they point to.

  • protocol: new SourceSpans with labels (acfeb9c5)

Bug Fixes

  • derive: allow unused variables for the snippets method (f704d6a9)

Features

  • protocol: implement From<(usize, usize)> for SourceSpan (36b86df9)

0.8.1 (2021-08-17)

Just a small bump to update the readme (and docs.rs in the process) with the new snippet derive stuff. No notable changes.

0.8.0 (2021-08-17)

You can full-on use #[derive(Diagnostic)] to define snippets now. That's a big deal.

Features

  • derive: Support for deriving snippet method (#18) (f6e6acf2)

0.7.0 (2021-08-16)

Welp. 0.6.0 was basically completely broken, so I tore out the darling-based derive macros and rewrote the whole thing using syn, and things are much better now!

There's still a few bits and bobs to add, like snippets (oof. big.), and full help format string support (they don't quite work in enums right now), but otherwise, this is pretty usable~

Features

  • derive: improved derive support, including partial help format string support! (9ef0dd26)

Bug Fixes

  • derive: move to plain syn to fix darling issues (9a78a943)

0.6.0 (2021-08-15)

We haz a basic derive macro now!

Features

  • derive: added basic derive macro (0e770270)

0.5.0 (2021-08-14)

I decided to yank some handy (optional) utilities from a project I'm using miette in. These should make using it more ergonomic.

Features

  • utils: various convenience utilities for creating and working with Diagnostics (a9601368)

0.4.0 (2021-08-11)

Time for another (still experimental!) change to Diagnostic. It will probably continue to change as miette gets experimented with, until 1.0.0 stabilizes it. But for now, expect semi-regular breaking changes of this kind.

Oh and I tracked down a rogue \n that was messing with the default reporter and managed to get out of it with at least some of my sanity.

Breaking Changes

  • protocol: Simplify protocol return values further (02dd1f84, breaks #)

Bug Fixes

  • reporter:
    • fix reporter and tests... again (d201dde4)
    • fix extra newline after header (0d2e3312)

0.3.1 (2021-08-11)

This is a tiny release to fix a reporter rendering bug.

Bug Fixes

  • reporter: fix missing newline before help text (9d430b6f)

0.3.0 (2021-08-08)

This version is the result of a lot of experimentation with getting the Diagnostic API right, particularly Diagnostic::snippets(), which is something that should be writable in several different ways. As such, it includes some breaking changes, but they shouldn't be too hard to figure out.

Breaking Changes

  • protocol:
    • improvements to snippets API (3584dc60)
    • help is a single Display ref now. (80e7dabb)

Bug Fixes

0.2.1 (2021-08-05)

I think this is the right thing to do re: From!

Bug Fixes

  • protocol: fix the default From<:T Diagnostic> implementation to cover more cases. (781a51f0)

0.2.0 (2021-08-05)

Starting to get some good feedback on the protocol and APIs, so some improvements were made.

Breaking changes

You might need to add + Send + Sync + 'static to your Box<dyn Diagnostic> usages now, since Diagnostic no longer constrains on any of them.

Additionally, Diagnostic::help(), Diagnostic::code(), and SpanContents have had signature changes that you'll need to adapt to.

  • protocol: protocol improvements after getting feedback (e955321c)
  • protocol: Make use of ? and return types with Diagnostics more ergonomic (50238d75)

0.1.0 (2021-08-05)

I'm really excited to put out this first release of miette! This version defines the current protocol and includes a basic snippet reporter. It's fully documented and ready to be used!

Disclaimer: This library is still under pretty heavy development, and you should only use this if you're interested in using something experimental. Any and all design comments and ideas are welcome over on GitHub

Bug Fixes

  • api: stop re-exporting random things wtf??? (2fb9f93c)
  • protocol: use references for all return values in Diagnostic (c3f41b97)

Features

  • protocol: sketched out a basic protocol (e2387ce2)
  • reporter: dummy reporter implementation + tests (a437f445)
  • span: make span end optional (1cb0ad38)

0.0.0 (2021-08-03)

Don't mind me, just parking this crate name.