Skip to content

Commit

Permalink
feat: highlight loc in debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
mverzilli committed Oct 9, 2023
1 parent 4ada9fa commit 23436e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tooling/debugger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ acvm.workspace = true
nargo.workspace = true
noirc_printable_type.workspace = true
thiserror.workspace = true
easy-repl = "0.2.1"
easy-repl = "0.2.1"
colored = "2.0.4"
4 changes: 3 additions & 1 deletion tooling/debugger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use thiserror::Error;
use easy_repl::{command, CommandStatus, Critical, Repl};
use std::cell::{Cell, RefCell};

use colored::Colorize;

enum SolveResult {
Done,
Ok,
Expand Down Expand Up @@ -109,7 +111,7 @@ impl<'backend, B: BlackBoxFunctionSolver> DebugContext<'backend, B> {
let start = loc.span.start() as usize;
let end = loc.span.end() as usize;
println!("At {}:{start}-{end}", file.path.as_path().display());
println!("\n{}\n", &source[start..end]);
println!("\n{}{}{}\n", &source[0..start], &source[start..end].reversed(), &source[end..]);
}
}
None => {}
Expand Down

0 comments on commit 23436e7

Please sign in to comment.