1
- /// Emit diagnostics using the `annotate-snippets` library
2
- ///
3
- /// This is the equivalent of `./emitter.rs` but making use of the
4
- /// [`annotate-snippets`][annotate_snippets] library instead of building the output ourselves.
5
- ///
6
- /// [annotate_snippets]: https://docs.rs/crate/annotate-snippets/
1
+ //! Emit diagnostics using the `annotate-snippets` library
2
+ //!
3
+ //! This is the equivalent of `./emitter.rs` but making use of the
4
+ //! [`annotate-snippets`][annotate_snippets] library instead of building the output ourselves.
5
+ //!
6
+ //! [annotate_snippets]: https://docs.rs/crate/annotate-snippets/
7
7
8
8
use syntax_pos:: { SourceFile , MultiSpan , Loc } ;
9
9
use crate :: {
@@ -18,16 +18,16 @@ use annotate_snippets::display_list::DisplayList;
18
18
use annotate_snippets:: formatter:: DisplayListFormatter ;
19
19
20
20
21
- /// Generates diagnostics using annotate-rs
22
- pub struct AnnotateRsEmitterWriter {
21
+ /// Generates diagnostics using annotate-snippet
22
+ pub struct AnnotateSnippetEmitterWriter {
23
23
source_map : Option < Lrc < SourceMapperDyn > > ,
24
24
/// If true, hides the longer explanation text
25
25
short_message : bool ,
26
26
/// If true, will normalize line numbers with LL to prevent noise in UI test diffs.
27
27
ui_testing : bool ,
28
28
}
29
29
30
- impl Emitter for AnnotateRsEmitterWriter {
30
+ impl Emitter for AnnotateSnippetEmitterWriter {
31
31
/// The entry point for the diagnostics generation
32
32
fn emit_diagnostic ( & mut self , db : & DiagnosticBuilder < ' _ > ) {
33
33
let primary_span = db. span . clone ( ) ;
@@ -158,7 +158,7 @@ impl<'a> DiagnosticConverter<'a> {
158
158
}
159
159
}
160
160
161
- impl AnnotateRsEmitterWriter {
161
+ impl AnnotateSnippetEmitterWriter {
162
162
pub fn new (
163
163
source_map : Option < Lrc < SourceMapperDyn > > ,
164
164
short_message : bool
0 commit comments