Show KCL backtraces (#7033)
* Add backtrace to errors * Add display of backtraces with hints * Change pane badge to only show count of errors * Fix property name to not collide with Error superclass * Increase min stack again * Add e2e test that checks that the diagnostics are created in CodeMirror * Remove unneeded code * Change to the new hotness
This commit is contained in:
@ -32,10 +32,10 @@ pub async fn appearance(exec_state: &mut ExecState, args: Args) -> Result<KclVal
|
||||
|
||||
// Make sure the color if set is valid.
|
||||
if !HEX_REGEX.is_match(&color) {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: format!("Invalid hex color (`{}`), try something like `#fff000`", color),
|
||||
source_ranges: vec![args.source_range],
|
||||
}));
|
||||
return Err(KclError::Semantic(KclErrorDetails::new(
|
||||
format!("Invalid hex color (`{}`), try something like `#fff000`", color),
|
||||
vec![args.source_range],
|
||||
)));
|
||||
}
|
||||
|
||||
let result = inner_appearance(
|
||||
@ -282,10 +282,10 @@ async fn inner_appearance(
|
||||
for solid_id in solids.ids(&args.ctx).await? {
|
||||
// Set the material properties.
|
||||
let rgb = rgba_simple::RGB::<f32>::from_hex(&color).map_err(|err| {
|
||||
KclError::Semantic(KclErrorDetails {
|
||||
message: format!("Invalid hex color (`{color}`): {err}"),
|
||||
source_ranges: vec![args.source_range],
|
||||
})
|
||||
KclError::Semantic(KclErrorDetails::new(
|
||||
format!("Invalid hex color (`{color}`): {err}"),
|
||||
vec![args.source_range],
|
||||
))
|
||||
})?;
|
||||
|
||||
let color = Color {
|
||||
|
Reference in New Issue
Block a user