Skip to content

Commit

Permalink
refactor: finish renaming hi-doc format
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed Aug 30, 2024
1 parent 5349cbf commit 761e429
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/jrsonnet-cli/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Parser, ValueEnum};
use jrsonnet_evaluator::trace::{
AssStrokeFormat, CompactFormat, ExplainingFormat, PathResolver, TraceFormat,
CompactFormat, ExplainingFormat, HiDocFormat, PathResolver, TraceFormat,
};

#[derive(PartialEq, Eq, ValueEnum, Clone)]
Expand Down Expand Up @@ -42,7 +42,7 @@ impl TraceOpts {
resolver,
max_trace,
}),
TraceFormatName::HiDoc => Box::new(AssStrokeFormat {
TraceFormatName::HiDoc => Box::new(HiDocFormat {
resolver,
max_trace,
}),
Expand Down
9 changes: 5 additions & 4 deletions crates/jrsonnet-evaluator/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ impl ExplainingFormat {

#[cfg(feature = "explaining-traces")]
#[derive(Trace)]
pub struct AssStrokeFormat {
pub struct HiDocFormat {
pub resolver: PathResolver,
pub max_trace: usize,
}
#[cfg(feature = "explaining-traces")]
impl TraceFormat for AssStrokeFormat {
impl TraceFormat for HiDocFormat {
fn write_trace(
&self,
out: &mut dyn std::fmt::Write,
Expand Down Expand Up @@ -420,7 +420,7 @@ impl TraceFormat for AssStrokeFormat {
let rendered = builder.build();
let ansi = source_to_ansi(&rendered);
if let Some(loc) = &last_location {
let _ = writeln!(out, "...because of {}", loc.0.source_path());
let _ = writeln!(out, "...at {}", loc.0.source_path());
}
let _ = write!(out, "{}", ansi.trim_end());
}
Expand Down Expand Up @@ -456,7 +456,8 @@ impl TraceFormat for AssStrokeFormat {
writeln!(out)?;
write!(out, "{flushed}")?;
}
write!(out, "{desc}")?;
writeln!(out)?;
write!(out, " {desc}")?;
}
}

Expand Down

0 comments on commit 761e429

Please sign in to comment.