From 2f1b10d0eec4ed3f1856ca88a665c69a68f5ab44 Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 20 Nov 2026 10:54:27 +0800 Subject: [PATCH] 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. --- crates/cli/src/commands.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/cli/src/commands.rs b/crates/cli/src/commands.rs index 8864ed4..ae89a7d 100644 --- a/crates/cli/src/commands.rs +++ b/crates/cli/src/commands.rs @@ -502,6 +502,15 @@ pub fn execute( } return 1; } + let warnings: Vec = 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 {