--- a/crates/jrsonnet-parser/src/expr.rs +++ b/crates/jrsonnet-parser/src/expr.rs @@ -329,7 +329,15 @@ pub struct LocExpr(pub Rc, pub Option); impl Debug for LocExpr { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?} from {:?}", self.0, self.1) + if f.alternate() { + write!(f, "{:#?}", self.0)?; + } else { + write!(f, "{:?}", self.0)?; + } + if let Some(loc) = &self.1 { + write!(f, " from {:?}", loc)?; + } + Ok(()) } }