Kat Marchán
dc2635e151
fix(graphical): stop rendering red vbars before the last item
2021-09-21 12:51:20 -07:00
Kat Marchán
183ecb9b78
feat(panic): add backtrace support to panic handler and move set_panic_hook into fancy features
2021-09-21 12:27:43 -07:00
Kat Marchán
11a708a224
feat(panic): Add basic panic handler and installation function
...
Fixes: https://github.com/zkat/miette/issues/22
2021-09-21 01:06:52 -07:00
Kat Marchán
a2548eddeb
misc: remove stale comment
2021-09-20 22:26:08 -07:00
Kat Marchán
338c885a30
feat(report): nicer, non-overlapping same-line highlights
2021-09-20 21:04:18 -07:00
Kat Marchán
6cd44a86c6
feat(handlers): Update graphical handler to use new label protocol ( #66 )
2021-09-20 14:27:25 -07:00
Kat Marchán
eb485658cc
feat(protocol): Make SourceCode Send+Sync
2021-09-19 18:57:51 -07:00
Kat Marchán
0ef2853f27
feat(labels): replace snippet stuff with simpler labels ( #62 )
2021-09-19 18:41:21 -07:00
Kat Marchán
eb1b7222fc
feat(report): add debug report as default, instead of narrated one
2021-09-17 10:29:00 -07:00
Kat Marchán
3e8a27e263
fix(protocol): implement source/cause for Box<dyn Diagnostic>
2021-09-16 19:08:12 -07:00
Kat Marchán
9901030eb1
feat(theme): more styling changes
2021-09-16 19:04:56 -07:00
Kat Marchán
12a9235bec
feat(theme): rename some theme items for clarity
...
BREAKING CHANGE: These were part of the public API, so if you were using theming, this might have broken for you
2021-09-16 19:04:33 -07:00
Kat Marchán
412436cd68
feat(footer): add footer support to graphical and narrated
...
Fixes: https://github.com/zkat/miette/issues/34
2021-09-16 14:19:04 -07:00
Kat Marchán
bc495e6ed4
feat(deps): move fancy reporter (and its deps) to a feature
...
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
Fixes: https://github.com/zkat/miette/issues/25
2021-09-16 13:21:41 -07:00
Kat Marchán
3d74a500c3
feat(report): make a single big MietteHandler that can switch modes
...
BREAKING CHANGE: linkification option method on GraphicalReportHandler has been changed to .with_links(bool)
2021-09-13 19:16:49 -07:00
Kat Marchán
8029f9c6c3
fix(report): miscellaneous, hacky tweaks to graphical rendering
2021-09-13 19:16:39 -07:00
Kat Marchán
673b435892
tests: remove compile_tests
2021-09-13 18:33:13 -07:00
Cormac Relf
2fa5551c81
feat(derive): Add `#[diagnostic(forward(field_name), code(...))]` ( #41 )
2021-09-13 15:39:04 -07:00
Robin Appelman
d994add912
fix(report): Fix end of previous line wrongly being included in highlight ( #52 )
2021-09-13 09:57:54 -07:00
Kat Marchán
eb07d5bd66
fix(report): fix wrapping for header and add wrapping for footer
2021-09-11 00:57:53 -07:00
Kat Marchán
eaebde92cf
feat(report): make header line as wide as terminal
2021-09-10 17:09:52 -07:00
Kat Marchán
bc72532465
feat(report): take terminal width into account for wrapping text
2021-09-10 12:39:10 -07:00
Kat Marchán
f482dcec6a
feat(report): wrap multiline messages to keep formatting
...
Fixes: https://github.com/zkat/miette/issues/51
2021-09-10 08:16:40 -07:00
Kat Marchán
1ba3f2f5d2
fix(report): get rid of the weird arrow thing. it does not look good
2021-09-10 07:36:09 -07:00
Kat Marchán
e4fdac38ea
fix(context): pass on diagnostic metadata when wrapping with `Report`
2021-09-09 20:27:27 -07:00
Kat Marchán
533ff5f348
fix(reporter): improve color situation and style things a little nicer
2021-09-08 20:59:19 -07:00
Kat Marchán
6422f82174
fix(report): don't color error message text to draw eyes back to it
2021-09-08 18:29:41 -07:00
Kat Marchán
824cd8bebe
feat(printer): use uparrow for empty highlights and fix 0-offset display bug
2021-09-07 17:41:28 -07:00
Kat Marchán
3f9da04b86
feat(report): anyhow-ify DiagnosticReport ( #35 )
...
This PR 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](https://github.com/nrc/rfcs/pull/1 ) that will make it possible to integrate `miette` directly with crates like `eyre` instead of having to use this specific `Report`.
As such, this PR is a major breaking change, especially for anyone using `DiagnosticReport` and company.
BREAKING CHANGES:
* `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`.
2021-09-04 21:22:46 -07:00
Sean Olson
0427c9f966
feat(source): Remove bound `T: Clone` from `Source` implementation for `Cow`. ( #42 )
...
This change removes the bound `T: Clone` in the implementation of
`Source` for `Cow<'_, T>`. This expands the implementation of `Source`
to include types like `Cow<'_, str>`. Importantly, `Cow` always requires
the bound `T: ToOwned` and uses `ToOwned` to implement `Clone` rather
than forwarding to `T::clone`.
2021-08-30 18:41:27 -07:00
Cormac Relf
84219f6c80
fix(printer): Show snippet message for unnamed sources ( #39 )
...
Fixes: https://github.com/zkat/miette/issues/38
2021-08-29 19:28:17 -07:00
Cormac Relf
50c7a88360
feat(Source): impl Source for str, &str (make &'static str usable for testing) ( #40 )
2021-08-29 19:07:07 -07:00
Felipe Seré
5a474370dd
fix(reporter): Only inc the line count if we haven't already done so with '\n' or '\r\n' ( #37 )
2021-08-29 12:33:45 -07:00
Cormac Relf
53f5d6d1d6
feat(derive): Add `#[diagnostic(transparent,forward)]` ( #36 )
...
Fixes: https://github.com/zkat/miette/issues/16
2021-08-29 12:33:16 -07:00
Tyler Bindon
9d6015996b
fix(printer): clamp highlight length to at least 1 ( #32 )
...
Fixes: https://github.com/zkat/miette/issues/31
2021-08-22 19:30:21 -07:00
Kat Marchán
61283e9efe
feat(snippets): Overhauled how snippets handle labels, sources, and messages, including the derive macro
...
BREAKING CHANGE: this will probably break a lot of your stuff. hopefully rustc helps
2021-08-22 19:06:47 -07:00
Kat Marchán
2d886c06a3
docs: dogfood url(docsrs)
2021-08-22 15:59:27 -07:00
Kat Marchán
7e76e2dea4
feat(links): added URL linking support and automatic docs.rs link generation
...
Fixes: https://github.com/zkat/miette/issues/17
2021-08-22 15:42:08 -07:00
Kat Marchán
3546dcec98
feat(theme): Add an initial `rgb` style with nicer colors
2021-08-22 10:56:10 -07:00
Kat Marchán
eb4ea3423a
docs: add error code aliases
...
miette can't do this yet, but I can still do it by hand!
2021-08-22 00:22:38 -07:00
Kat Marchán
0fecc42f76
fmt: cargo fmt --all
2021-08-21 23:24:45 -07:00
Kat Marchán
949174e598
misc: more aggressive linting for quality~
2021-08-21 23:13:25 -07:00
Kat Marchán
20bb3db3fa
docs: overhaul readme and make sure everything is documented
...
Fixes: https://github.com/zkat/miette/issues/15
2021-08-21 22:57:16 -07:00
Kat Marchán
c1da4a0d27
feat(into_diagnostic): .into_diagnostic() is now generic across any impl fmt::Display instead of expecting a `dyn`
2021-08-21 22:55:45 -07:00
Kat Marchán
5c077d30a4
fix(protocol): oops, missed a spot after a rename
2021-08-21 22:54:59 -07:00
Kat Marchán
aafa4a3de1
feat(printer): rename default printer and consistify some naming conventions with printing
...
BREAKING CHANGE: This is a significant API break.
2021-08-21 22:52:06 -07:00
Kat Marchán
e980b72373
feat(error): diagnostic-ify MietteError
2021-08-21 22:49:00 -07:00
Kat Marchán
5369a9424e
feat(printer): added (and hooked up) an accessible report printer
...
Fixes: https://github.com/zkat/miette/issues/28
2021-08-21 15:32:31 -07:00
Kat Marchán
b5c4118e59
misc: cargo fmt
2021-08-21 00:11:41 -07:00
Kat Marchán
5fbcd53026
feat(printer): lots of small improvements to printer
2021-08-20 23:52:15 -07:00