• Home
  • Raw
  • Download

Lines Matching full:diagnostic

9 `miette` is a diagnostic library for Rust. It includes a series of
14diagnostic printer that's enabled in various situations, such as when you use NO_COLOR or CLICOLOR…
25 diagnostic help: This is a bug. It might be in ruget, or it might be in the
27 diagnostic error code: ruget::api::bad_json
45 - [... diagnostic code URLs](#-diagnostic-code-urls)
57 - Generic [`Diagnostic`] protocol, compatible (and dependent on)
59 - Unique error codes on every [`Diagnostic`].
61 - Super handy derive macro for defining diagnostic metadata.
71 - Fancy graphical [diagnostic output](#about), using ANSI/Unicode text
78 - Turns diagnostic codes into links in [supported terminals](https://gist.github.com/egmontkob/eb11…
96 You can derive a `Diagnostic` from any `std::error::Error` type.
100 use miette::{Diagnostic, SourceSpan};
103 #[derive(Error, Debug, Diagnostic)]
105 #[diagnostic(
115 // Snippets and highlights can be included in the diagnostic!
163 Diagnostic severity: error
170 diagnostic help: Change int or string to be the right types and try again.
171 diagnostic code: nu::parser::unsupported_operation
186 If you don't want to use the [`Diagnostic`] derive macro, you can implement
191 use miette::{Diagnostic, SourceSpan};
194 #[derive(Error, Diagnostic, Debug)]
197 #[diagnostic(code(my_lib::io_error))]
201 #[diagnostic(code(my_lib::bad_code))]
205 … // Use `#[diagnostic(transparent)]` to wrap another [`Diagnostic`]. You won't see labels otherwise
206 #[diagnostic(transparent)]
210 #[derive(Error, Diagnostic, Debug)]
230 `std::error::Error`s into [`Diagnostic`]s. Additionally, there's a
233 When dealing with non-`Diagnostic` types, you'll want to
247 that you can import to add ad-hoc context messages to your `Diagnostic`s, as
301 Please note: in order to get fancy diagnostic rendering with all the pretty
309 Another way to display a diagnostic is by printing them using the debug formatter.
326 #### ... diagnostic code URLs
342 To use this, you can add a `url()` sub-param to your `#[diagnostic]`
346 use miette::Diagnostic;
349 #[derive(Error, Diagnostic, Debug)]
351 #[diagnostic(
362 link to this diagnostic on `docs.rs`, so folks can just go straight to your
363 (very high quality and detailed!) documentation on this diagnostic:
366 use miette::Diagnostic;
369 #[derive(Error, Diagnostic, Debug)]
370 #[diagnostic(
393 `derive(Diagnostic)` macro:
396 use miette::{Diagnostic, SourceSpan};
399 #[derive(Diagnostic, Debug, Error)]
401 #[diagnostic(code(my_lib::random_error))]
434 use miette::Diagnostic;
437 #[derive(Debug, Diagnostic, Error)]
439 #[diagnostic(help("try doing this instead"))]
444 your diagnostic:
447 use miette::Diagnostic;
450 #[derive(Debug, Diagnostic, Error)]
452 #[diagnostic()]
465 `miette` supports collecting multiple errors into a single diagnostic, and
469 `Diagnostic` type:
472 use miette::Diagnostic;
475 #[derive(Debug, Error, Diagnostic)]
490 use miette::{Diagnostic, SourceSpan};
493 #[derive(Diagnostic, Debug, Error)]
495 #[diagnostic()]
522 use miette::{Diagnostic, Report, SourceSpan};
525 #[derive(Diagnostic, Debug, Error)]
527 #[diagnostic()]
534 #[derive(Diagnostic, Debug, Error)]
536 #[diagnostic()]
566 #### ... Diagnostic-based error sources.
571 if the source of the diagnostic is a diagnostic itself, the source will
583 use miette::Diagnostic;
586 #[derive(Debug, Diagnostic, Error)]
594 #[derive(Debug, Diagnostic, Error)]
630 then you may want to use [`miette!`], [`diagnostic!`] macros or
631 [`MietteDiagnostic`] directly to create diagnostic on the fly.
655 field of your [`Diagnostic`].
707 [`diagnostic!`]: https://docs.rs/miette/latest/miette/macro.diagnostic.html
709 [`Diagnostic`]: https://docs.rs/miette/latest/miette/trait.Diagnostic.html