1
Fork 0

Rename Diagnostic as DiagInner.

I started by changing it to `DiagData`, but that didn't feel right.
`DiagInner` felt much better.
This commit is contained in:
Nicholas Nethercote 2024-02-22 18:32:06 +11:00
parent 1e4f9e302c
commit 6588f5b749
14 changed files with 87 additions and 87 deletions

View file

@ -9,7 +9,7 @@ use crate::emitter::FileWithAnnotatedLines;
use crate::snippet::Line;
use crate::translation::{to_fluent_args, Translate};
use crate::{
CodeSuggestion, Diagnostic, DiagnosticMessage, Emitter, ErrCode, FluentBundle,
CodeSuggestion, DiagInner, DiagnosticMessage, Emitter, ErrCode, FluentBundle,
LazyFallbackBundle, Level, MultiSpan, Style, SubDiagnostic,
};
use annotate_snippets::{Annotation, AnnotationType, Renderer, Slice, Snippet, SourceAnnotation};
@ -44,7 +44,7 @@ impl Translate for AnnotateSnippetEmitter {
impl Emitter for AnnotateSnippetEmitter {
/// The entry point for the diagnostics generation
fn emit_diagnostic(&mut self, mut diag: Diagnostic) {
fn emit_diagnostic(&mut self, mut diag: DiagInner) {
let fluent_args = to_fluent_args(diag.args.iter());
let mut suggestions = diag.suggestions.unwrap_or(vec![]);
@ -82,7 +82,7 @@ fn source_string(file: Lrc<SourceFile>, line: &Line) -> String {
file.get_line(line.line_index - 1).map(|a| a.to_string()).unwrap_or_default()
}
/// Maps `Diagnostic::Level` to `snippet::AnnotationType`
/// Maps `diagnostic::Level` to `snippet::AnnotationType`
fn annotation_type_for_level(level: Level) -> AnnotationType {
match level {
Level::Bug | Level::Fatal | Level::Error | Level::DelayedBug => AnnotationType::Error,