feat(cli): surface compile warnings on run/call

Non-error diagnostics (for example `markdown.inert_executable` for a would-be
execution node outside any function body) are now printed to stderr before
execution and included in `--json` run output, instead of being silently
hidden on a successful run.
This commit is contained in:
cflmy committed 2026-11-20 10:54:27 +08:00
1 parent 847c2c1580
commit 2f1b10d0ee
1 file changed
+10
+10
View File
@@ -502,6 +502,15 @@ pub fn execute(
}
return 1;
}
let warnings: Vec<FileDiagnostic> = project
.diagnostics
.iter()
.filter(|item| !item.diagnostic.is_error())
.cloned()
.collect();
if !json && !warnings.is_empty() {
eprint!("{}", output::render_text(&warnings));
}
let mode = match settings.sandbox_mode() {
Ok(mode) => mode,
Err(error) => {
@@ -584,6 +593,7 @@ pub fn execute(
"success": true,
"value": marqdo_value::to_wire(&outcome.value),
"stdout": stdout_text,
"diagnostics": output::diagnostics_json(&project.diagnostics),
"trace": trace_entries,
}));
} else {