Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmaddock committed Jan 8, 2025
1 parent 65dd1f6 commit 13cc9d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/symbolicli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ mod event {
function: value.function,
filename: value.filename,
module: value.module,
abs_path: value.abs_path?,
lineno: value.lineno?,
abs_path: value.abs_path,
lineno: value.lineno,
colno: value.colno,
pre_context: value.pre_context,
context_line: value.context_line,
Expand Down
20 changes: 15 additions & 5 deletions crates/symbolicli/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ fn print_compact_js(mut response: CompletedJsSymbolicationResponse) {
let filename = filename.unwrap_or_default();
row.add_cell(cell!(filename));

row.add_cell(cell!(lineno));
let line = lineno.map(|line| line.to_string()).unwrap_or_default();
row.add_cell(cell!(line));

let col = colno.map(|col| col.to_string()).unwrap_or_default();
row.add_cell(cell!(col));
Expand Down Expand Up @@ -290,10 +291,19 @@ fn print_pretty_js(mut response: CompletedJsSymbolicationResponse) {
table.add_row(row![r->" File:", name]);
}

if let Some(col) = *colno {
table.add_row(row![r->" Line/Column:", format!("{lineno}:{col}")]);
} else {
table.add_row(row![r->" Line:", format!("{lineno}")]);
match (colno, lineno) {
(Some(col), Some(line)) => {
table.add_row(row![r->" Line/Column:", format!("{}:{}", line, col)]);
}
(Some(col), None) => {
table.add_row(row![r->" Column:", format!("{}", col)]);
}
(None, Some(line)) => {
table.add_row(row![r->" Line:", format!("{}", line)]);
}
(None, None) => {
table.add_row(row![r->" Line/Column:", "N/A"]);
}
}

table.add_empty_row();
Expand Down

0 comments on commit 13cc9d3

Please sign in to comment.