Remove unnecessary label messages
This commit is contained in:
parent
f82b368fe1
commit
4a2f72fabf
2 changed files with 14 additions and 26 deletions
|
|
@ -102,9 +102,7 @@ impl<'a, F: Files<'a>> Eprint<'a, F> for Error<F::FileId> {
|
||||||
let prev_str = Self::fmt_date_time(*prev, *prev_time);
|
let prev_str = Self::fmt_date_time(*prev, *prev_time);
|
||||||
Diagnostic::error()
|
Diagnostic::error()
|
||||||
.with_message("Delta step resulted in invalid date")
|
.with_message("Delta step resulted in invalid date")
|
||||||
.with_labels(vec![
|
.with_labels(vec![Label::primary(*index, span)])
|
||||||
Label::primary(*index, span).with_message("At this step")
|
|
||||||
])
|
|
||||||
.with_notes(vec![
|
.with_notes(vec![
|
||||||
format!("Date before applying delta: {start_str}"),
|
format!("Date before applying delta: {start_str}"),
|
||||||
format!("Date before applying this step: {prev_str}"),
|
format!("Date before applying this step: {prev_str}"),
|
||||||
|
|
@ -117,9 +115,7 @@ impl<'a, F: Files<'a>> Eprint<'a, F> for Error<F::FileId> {
|
||||||
prev,
|
prev,
|
||||||
} => Diagnostic::error()
|
} => Diagnostic::error()
|
||||||
.with_message("Time-based delta step applied to date without time")
|
.with_message("Time-based delta step applied to date without time")
|
||||||
.with_labels(vec![
|
.with_labels(vec![Label::primary(*index, span)])
|
||||||
Label::primary(*index, span).with_message("At this step")
|
|
||||||
])
|
|
||||||
.with_notes(vec![
|
.with_notes(vec![
|
||||||
format!("Date before applying delta: {start}"),
|
format!("Date before applying delta: {start}"),
|
||||||
format!("Date before applying this step: {prev}"),
|
format!("Date before applying this step: {prev}"),
|
||||||
|
|
@ -131,7 +127,7 @@ impl<'a, F: Files<'a>> Eprint<'a, F> for Error<F::FileId> {
|
||||||
to,
|
to,
|
||||||
} => Diagnostic::error()
|
} => Diagnostic::error()
|
||||||
.with_message("Repeat delta did not move forwards")
|
.with_message("Repeat delta did not move forwards")
|
||||||
.with_labels(vec![Label::primary(*index, span).with_message("This delta")])
|
.with_labels(vec![Label::primary(*index, span)])
|
||||||
.with_notes(vec![format!("Moved from {from} to {to}")]),
|
.with_notes(vec![format!("Moved from {from} to {to}")]),
|
||||||
Error::RemindDidNotMoveBackwards {
|
Error::RemindDidNotMoveBackwards {
|
||||||
index,
|
index,
|
||||||
|
|
@ -140,25 +136,21 @@ impl<'a, F: Files<'a>> Eprint<'a, F> for Error<F::FileId> {
|
||||||
to,
|
to,
|
||||||
} => Diagnostic::error()
|
} => Diagnostic::error()
|
||||||
.with_message("Remind delta did not move backwards")
|
.with_message("Remind delta did not move backwards")
|
||||||
.with_labels(vec![Label::primary(*index, span).with_message("This delta")])
|
.with_labels(vec![Label::primary(*index, span)])
|
||||||
.with_notes(vec![format!("Moved from {from} to {to}")]),
|
.with_notes(vec![format!("Moved from {from} to {to}")]),
|
||||||
Error::MoveWithoutSource { index, span } => Diagnostic::error()
|
Error::MoveWithoutSource { index, span } => Diagnostic::error()
|
||||||
.with_message("Tried to move nonexistent entry")
|
.with_message("Tried to move nonexistent entry")
|
||||||
.with_labels(vec![Label::primary(*index, span).with_message("Here")]),
|
.with_labels(vec![Label::primary(*index, span)]),
|
||||||
Error::TimedMoveWithoutTime { index, span } => Diagnostic::error()
|
Error::TimedMoveWithoutTime { index, span } => Diagnostic::error()
|
||||||
.with_message("Tried to move un-timed entry to new time")
|
.with_message("Tried to move un-timed entry to new time")
|
||||||
.with_labels(vec![Label::primary(*index, span).with_message("Here")]),
|
.with_labels(vec![Label::primary(*index, span)]),
|
||||||
Error::DivByZero { index, span, date } => Diagnostic::error()
|
Error::DivByZero { index, span, date } => Diagnostic::error()
|
||||||
.with_message("Tried to divide by zero")
|
.with_message("Tried to divide by zero")
|
||||||
.with_labels(vec![
|
.with_labels(vec![Label::primary(*index, span)])
|
||||||
Label::primary(*index, span).with_message("This expression")
|
|
||||||
])
|
|
||||||
.with_notes(vec![format!("At date: {date}")]),
|
.with_notes(vec![format!("At date: {date}")]),
|
||||||
Error::ModByZero { index, span, date } => Diagnostic::error()
|
Error::ModByZero { index, span, date } => Diagnostic::error()
|
||||||
.with_message("Tried to modulo by zero")
|
.with_message("Tried to modulo by zero")
|
||||||
.with_labels(vec![
|
.with_labels(vec![Label::primary(*index, span)])
|
||||||
Label::primary(*index, span).with_message("This expression")
|
|
||||||
])
|
|
||||||
.with_notes(vec![format!("At date: {date}")]),
|
.with_notes(vec![format!("At date: {date}")]),
|
||||||
Error::Easter {
|
Error::Easter {
|
||||||
index,
|
index,
|
||||||
|
|
@ -167,9 +159,7 @@ impl<'a, F: Files<'a>> Eprint<'a, F> for Error<F::FileId> {
|
||||||
msg,
|
msg,
|
||||||
} => Diagnostic::error()
|
} => Diagnostic::error()
|
||||||
.with_message("Failed to calculate easter")
|
.with_message("Failed to calculate easter")
|
||||||
.with_labels(vec![
|
.with_labels(vec![Label::primary(*index, span)])
|
||||||
Label::primary(*index, span).with_message("This expression")
|
|
||||||
])
|
|
||||||
.with_notes(vec![format!("At date: {date}"), format!("Reason: {msg}")]),
|
.with_notes(vec![format!("At date: {date}"), format!("Reason: {msg}")]),
|
||||||
};
|
};
|
||||||
Self::eprint_diagnostic(files, config, &diagnostic);
|
Self::eprint_diagnostic(files, config, &diagnostic);
|
||||||
|
|
|
||||||
|
|
@ -154,9 +154,7 @@ impl<'a> Eprint<'a, Files> for Error {
|
||||||
} => {
|
} => {
|
||||||
let diagnostic = Diagnostic::error()
|
let diagnostic = Diagnostic::error()
|
||||||
.with_message(format!("Could not resolve time zone {tz}"))
|
.with_message(format!("Could not resolve time zone {tz}"))
|
||||||
.with_labels(vec![
|
.with_labels(vec![Label::primary(*file, span)])
|
||||||
Label::primary(*file, span).with_message("Time zone defined here")
|
|
||||||
])
|
|
||||||
.with_notes(vec![format!("{error}")]);
|
.with_notes(vec![format!("{error}")]);
|
||||||
Self::eprint_diagnostic(files, config, &diagnostic);
|
Self::eprint_diagnostic(files, config, &diagnostic);
|
||||||
}
|
}
|
||||||
|
|
@ -178,8 +176,8 @@ impl<'a> Eprint<'a, Files> for Error {
|
||||||
let diagnostic = Diagnostic::error()
|
let diagnostic = Diagnostic::error()
|
||||||
.with_message(format!("Time zone conflict between {tz1} and {tz2}"))
|
.with_message(format!("Time zone conflict between {tz1} and {tz2}"))
|
||||||
.with_labels(vec![
|
.with_labels(vec![
|
||||||
Label::primary(*file1, span1).with_message("Time zone defined here"),
|
Label::primary(*file1, span1),
|
||||||
Label::primary(*file2, span2).with_message("Time zone defined here"),
|
Label::primary(*file2, span2),
|
||||||
])
|
])
|
||||||
.with_notes(vec![
|
.with_notes(vec![
|
||||||
"All TIMEZONE commands must set the same time zone.".to_string()
|
"All TIMEZONE commands must set the same time zone.".to_string()
|
||||||
|
|
@ -213,8 +211,8 @@ impl<'a> Eprint<'a, Files> for Error {
|
||||||
let diagnostic = Diagnostic::error()
|
let diagnostic = Diagnostic::error()
|
||||||
.with_message(format!("Duplicate log entries for {date}"))
|
.with_message(format!("Duplicate log entries for {date}"))
|
||||||
.with_labels(vec![
|
.with_labels(vec![
|
||||||
Label::primary(*file1, span1).with_message("Log defined here"),
|
Label::primary(*file1, span1),
|
||||||
Label::primary(*file2, span2).with_message("Log defined here"),
|
Label::primary(*file2, span2),
|
||||||
])
|
])
|
||||||
.with_notes(vec!["A day can have at most one LOG entry.".to_string()]);
|
.with_notes(vec!["A day can have at most one LOG entry.".to_string()]);
|
||||||
Self::eprint_diagnostic(files, config, &diagnostic);
|
Self::eprint_diagnostic(files, config, &diagnostic);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue