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:
@ -276,8 +276,8 @@ impl ExecState {
|
||||
}
|
||||
|
||||
pub(super) fn circular_import_error(&self, path: &ModulePath, source_range: SourceRange) -> KclError {
|
||||
KclError::ImportCycle(KclErrorDetails {
|
||||
message: format!(
|
||||
KclError::ImportCycle(KclErrorDetails::new(
|
||||
format!(
|
||||
"circular import of modules is not allowed: {} -> {}",
|
||||
self.global
|
||||
.mod_loader
|
||||
@ -288,8 +288,8 @@ impl ExecState {
|
||||
.join(" -> "),
|
||||
path,
|
||||
),
|
||||
source_ranges: vec![source_range],
|
||||
})
|
||||
vec![source_range],
|
||||
))
|
||||
}
|
||||
|
||||
pub(crate) fn pipe_value(&self) -> Option<&KclValue> {
|
||||
@ -389,14 +389,14 @@ impl MetaSettings {
|
||||
self.kcl_version = value;
|
||||
}
|
||||
name => {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: format!(
|
||||
return Err(KclError::Semantic(KclErrorDetails::new(
|
||||
format!(
|
||||
"Unexpected settings key: `{name}`; expected one of `{}`, `{}`",
|
||||
annotations::SETTINGS_UNIT_LENGTH,
|
||||
annotations::SETTINGS_UNIT_ANGLE
|
||||
),
|
||||
source_ranges: vec![annotation.as_source_range()],
|
||||
}))
|
||||
vec![annotation.as_source_range()],
|
||||
)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user