Skip to content

Commit

Permalink
fix(report): get rid of the weird arrow thing. it does not look good
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Sep 10, 2021
1 parent ecc705d commit 1ba3f2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
15 changes: 2 additions & 13 deletions src/handlers/graphical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,7 @@ impl GraphicalReportHandler {
writeln!(f, "{}", self.theme.characters.hbar.to_string().repeat(20),)?;
writeln!(f)?;
write!(f, " {} ", severity_icon.style(severity_style))?;
if diagnostic.source().is_some() {
write!(f, "{}", self.theme.characters.mtop.style(severity_style))?;
} else {
write!(f, "{}", self.theme.characters.hbar.style(severity_style))?;
}
writeln!(
f,
"{}{} {}",
self.theme.characters.hbar.style(severity_style),
self.theme.characters.rarrow.style(severity_style),
diagnostic,
)?;
writeln!(f, "{}", diagnostic,)?;
Ok(())
}

Expand All @@ -133,7 +122,7 @@ impl GraphicalReportHandler {
self.theme.characters.lbot
};
let prefix = format!(
" {}{}{}",
" {}{}{}",
char, self.theme.characters.hbar, self.theme.characters.rarrow
)
.style(severity_style)
Expand Down
24 changes: 12 additions & 12 deletions tests/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn single_line_highlight() -> Result<(), MietteError> {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ source
Expand Down Expand Up @@ -91,7 +91,7 @@ fn single_line_highlight_offset_zero() -> Result<(), MietteError> {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ source
Expand Down Expand Up @@ -134,7 +134,7 @@ fn single_line_highlight_with_empty_span() -> Result<(), MietteError> {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ source
Expand Down Expand Up @@ -177,7 +177,7 @@ fn single_line_highlight_no_label() -> Result<(), MietteError> {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ source
Expand Down Expand Up @@ -222,7 +222,7 @@ fn multiple_same_line_highlights() -> Result<(), MietteError> {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ source
Expand Down Expand Up @@ -266,7 +266,7 @@ fn multiline_highlight_adjacent() -> Result<(), MietteError> {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ source
Expand Down Expand Up @@ -317,7 +317,7 @@ line5
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ ╭──▶ line1
Expand Down Expand Up @@ -382,9 +382,9 @@ line5
let expected = r#"
────[oops::my::bad]────────────────────
× ┬─▶ wtf?!
├─▶ something went wrong
╰─▶ very much went wrong
× wtf?!
├─▶ something went wrong
╰─▶ very much went wrong
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ ╭──▶ line1
Expand Down Expand Up @@ -431,7 +431,7 @@ fn multiple_multiline_highlights_adjacent() -> Result<(), MietteError> {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[bad_file.rs:1:1] This is the part that broke:
1 │ ╭─▶ source
Expand Down Expand Up @@ -577,7 +577,7 @@ fn unnamed_snippet_shows_message() {
let expected = r#"
────[oops::my::bad]────────────────────
× ──▶ oops!
× oops!
╭───[1:1] This is the part that broke:
1 │ source_text_here
Expand Down

0 comments on commit 1ba3f2f

Please sign in to comment.