diff --git a/notes.org b/notes.org index 3286ee1..bb87926 100644 --- a/notes.org +++ b/notes.org @@ -208,6 +208,8 @@ i will use rustyline, since it seems like the most feature-complete * DONE handle non-interactive input better +* DONE show marking where error occurs + * TODO cli tests using insta-cmd https://insta.rs/docs/cmd/ diff --git a/src/error_display.rs b/src/error_display.rs index 838acd4..9feab85 100644 --- a/src/error_display.rs +++ b/src/error_display.rs @@ -12,7 +12,11 @@ impl OSDBError for CommandParseError { } else { Report::build(ReportKind::Error, (file, 0..input.len() - 1)) .with_message(self.message()) - .with_label(Label::new((file, 0..input.len() - 1)).with_color(Color::Red)) + .with_label( + Label::new((file, 0..input.len() - 1)) + .with_color(Color::Red) + .with_message(self.message()), + ) .finish() .print((file, Source::from(input))) .unwrap(); @@ -25,7 +29,11 @@ impl OSDBError for ScanError { let location = (file, Into::>::into(&self.location)); Report::build(ReportKind::Error, location.clone()) .with_message(format!("{self}")) - .with_label(Label::new(location).with_color(Color::Red)) + .with_label( + Label::new(location) + .with_color(Color::Red) + .with_message(format!("{self}")), + ) .finish() .print((file, Source::from(input))) .unwrap();