fix source ranges

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-04-05 15:36:05 -07:00
parent 0f9bed70a6
commit f00a7059a2
2 changed files with 42 additions and 40 deletions

View File

@ -748,7 +748,7 @@ impl ExecutorContext {
) = tokio::sync::mpsc::channel(1);
for module in modules {
let Some((module_id, module_path, program)) = universe.get(&module) else {
let Some((import_stmt, module_id, module_path, program)) = universe.get(&module) else {
return Err(KclErrorWithOutputs::no_outputs(KclError::Internal(KclErrorDetails {
message: format!("Module {module} not found in universe"),
source_ranges: Default::default(),
@ -760,6 +760,7 @@ impl ExecutorContext {
let exec_state = exec_state.clone();
let exec_ctxt = self.clone();
let results_tx = results_tx.clone();
let source_range = SourceRange::from(import_stmt);
#[cfg(target_arch = "wasm32")]
{
@ -769,13 +770,7 @@ impl ExecutorContext {
let exec_ctxt = exec_ctxt;
let result = exec_ctxt
.exec_module_from_ast(
&program,
module_id,
&module_path,
&mut exec_state,
Default::default(),
)
.exec_module_from_ast(&program, module_id, &module_path, &mut exec_state, source_range)
.await;
results_tx
@ -791,13 +786,7 @@ impl ExecutorContext {
let exec_ctxt = exec_ctxt;
let result = exec_ctxt
.exec_module_from_ast(
&program,
module_id,
&module_path,
&mut exec_state,
Default::default(),
)
.exec_module_from_ast(&program, module_id, &module_path, &mut exec_state, source_range)
.await;
results_tx