Commit Graph

58 Commits

Author SHA1 Message Date
Yiyu Lin 22b29eec38
docs: use `cargo readme` to update (#351) 2024-02-27 21:58:02 -08:00
Yiyu Lin 62cfd221ba
docs: add `severity` example (#350)
Co-authored-by: hzlinyiyu <hzlinyiyu@corp.netease.com>
2024-02-23 07:43:22 -08:00
Nahor 03060245d8
feat(collection): add support for collection of labels (#341)
Fixes: https://github.com/zkat/miette/issues/315

Allow errors to have a number of labels determined at runtime.
An example of this is when the rust compiler labels all the arms of
a `match` expression when one of them has an incompatible type

To allow customization of the text for each label in a collection, add
support for using LabeledSpan in collections instead of just regular
spans
2024-02-15 18:14:04 -08:00
Kat Marchán ab59a7bc9b
feat(MSRV): Actually bump the MSRV to 1.70.0 2024-02-03 19:59:57 -08:00
Adam Curtis 1df3b1a537
feat(source): Allow inner source type of a NamedSource to be borrowed (#254)
BREAKING CHANGE: This makes the `NamedSource` type generic over its `Source` type, instead of boxing it.
2024-02-03 19:40:17 -08:00
Jonathan Dönszelmann 251d6d5929
fix(docs): add example to README and docs fixing #96 (#319) 2023-11-15 10:35:46 -08:00
Andre Meyering d37ada876a
docs(README): Move import of `NamedResult` to where it is used (#309)
An example in README.md makes use of `miette::NamedResult` .
It is imported in the second "example-step", but already used in the first one. Beginners, that copy the example step-by-step to understand it, will run into compile errors, as `NamedResult` was not imported.
2023-10-23 10:09:00 -07:00
Thomas Versteeg ba313282a8
docs: typo in README.md (#295)
Dynamic diagnostics example contains a macro invocation without a '!' symbol.
2023-09-29 06:56:09 -07:00
Kat Marchán 10c3b7f809
docs: update readme again 2023-07-15 18:48:00 -07:00
Gavrilikhin Daniil bfacb6329f
doc: document `#[diagnostic(transparent)]` (#266) 2023-07-15 18:46:54 -07:00
0x009922 89806755a4
docs: a little cleaning in README (#274) 2023-06-28 18:42:12 -07:00
Khang Nguyen Duy 01b60a7df8
docs: fix broken links (#275)
the links point to structs, whereas it should be traits
2023-06-24 22:15:28 -07:00
Gavrilikhin Daniil 024145dbdd
Add dynamic diagnostic (#262) 2023-05-13 13:59:43 -07:00
Lucas Kent ebc61b5cf8
docs: Mention miette::miette! macro under "... in application code" (#233) 2023-01-30 10:21:50 -08:00
Xuanwo 5815eab310
docs: Fix typo of Diagnostic link in README (#210) 2022-10-13 09:20:29 -07:00
Pig Fang 12279f83a8
docs: remove sentence about `cargo-edit` (#198) 2022-08-21 08:33:51 -07:00
Kat Marchán e286c705fd
fix(docs): readme was getting cut off during generation
Fixes: https://github.com/zkat/miette/issues/174
2022-07-24 10:24:07 -07:00
Kat Marchán 0a4cf4ad24
fix(tests): add Display impl to diagnostic_source example 2022-05-05 12:44:49 -07:00
Kat Marchán a03bfe2e1b
docs: document new diagnostic_source feature 2022-05-05 08:56:27 -07:00
Kat Marchán 45093c2f58
feat(help): update macro to allow optional help text (#152)
Fixes: https://github.com/zkat/miette/issues/148
2022-04-17 18:19:28 -07:00
Dylan Anthony 126ffc5834
docs(readme): Fix a couple links (#141) 2022-03-27 15:07:28 -07:00
Moritz Mœller 5d23c0d61d
fix(docs): Docs overhaul (#124)
* Fixed/formatted all intradoc links. Various other small doc fixes/typography/etc.

* Clarified semantic similarity with anyhow/eyre types/macros.

* Removed unused MietteError::SetPrinterFailure.

* README now generaed from lib.rs via `cargo readme`.

* More doc fixes, made ErrorHook type public.

* Indentation (docs).
2022-02-25 08:39:18 -08:00
Paul Colomiets 9d50daf351 docs: Add an example of delayed source code 2022-02-19 16:58:48 -08:00
Kirill Vasiltsov 1f70140c2e
feat(tabs): Add replace tabs with spaces option (#82)
Fixes: https://github.com/zkat/miette/issues/73
2021-10-05 21:05:57 -07:00
Coenen Benjamin ebdee4f455
docs: fix set_reporter to set_hook (#79)
* docs: fix set_reporter to set_hook

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>

* docs: rename MietteHandlerOptions to MietteHandlerOpts

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-10-01 12:08:28 -07:00
Kat Marchán 50e82199e6
docs: oops wrong name 2021-09-26 13:11:45 -07:00
Kat Marchán bb25edf019
docs: fix doctests 2021-09-26 13:00:39 -07:00
Kat Marchán c337e2759f
docs: add docs for #[related] 2021-09-26 12:55:30 -07:00
Kat Marchán 47e4d4d05c
docs: add docs for handler options 2021-09-26 12:45:18 -07:00
Kat Marchán f92c75f176
docs: update readme with info about fancy feature 2021-09-22 16:36:41 -07:00
Kat Marchán 468843aa5c docs: update readme a bit more 2021-09-22 16:34:21 -07:00
Kat Marchán 2bbac6c2a7 docs: update readme with latest screenshots 2021-09-22 16:34:21 -07:00
Kat Marchán b10693a91c tests: fix doctests and such 2021-09-22 16:34:21 -07:00
Kat Marchán 247e8f8b39 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-22 16:34:21 -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
Tobias Bieniek d6eda1e11c
docs: Fix typo in readme (#33) 2021-08-23 07:46:06 -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 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 ffee3753f0
docs: add acknowledgements section
Fixes: https://github.com/zkat/miette/issues/24
2021-08-21 23:08:11 -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 fe3abdc64d
docs: add narratable printouts to README 2021-08-21 15:32:50 -07:00
Kat Marchán 5fd2765bf0
docs: update readme with new stuff 2021-08-21 00:11:40 -07:00
Kat Marchán d675334e48
feat(reporter): fancy new reporter with unicode, colors, and multiline (#23)
Fixes: https://github.com/zkat/miette/issues/3
Fixes: https://github.com/zkat/miette/issues/5
2021-08-20 20:09:23 -07:00
Kat Marchán 8fbad1b1cd
feat(derive): format string support for help()
Fixes: https://github.com/zkat/miette/issues/7
2021-08-18 19:59:50 -07:00
Kat Marchán 29c1403efd
feat(reporter): Overhauled return type/main/DiagnosticReport experience.
Fixes: https://github.com/zkat/miette/issues/13
2021-08-17 23:41:03 -07:00
Kat Marchán f390520b45
feat(protocol): reference-based DiagnosticReport! 2021-08-17 15:30:52 -07:00
Kat Marchán b7deb2d002
docs: update readme oops 2021-08-17 09:05:53 -07:00
Kat Marchán acfeb9c5b0
feat(protocol): new SourceSpans with labels 2021-08-17 08:41:20 -07:00
Kat Marchán 36b86df9f5
feat(protocol): implement From<(usize, usize)> for SourceSpan 2021-08-16 23:46:32 -07:00
Kat Marchán 698bb0eff5
docs: update readme 2021-08-16 22:41:40 -07:00