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:
1 parent
847c2c1580
commit
2f1b10d0ee
1 file changed
+10
@@ -502,6 +502,15 @@ pub fn execute(
|
|||||||
}
|
}
|
||||||
return 1;
|
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() {
|
let mode = match settings.sandbox_mode() {
|
||||||
Ok(mode) => mode,
|
Ok(mode) => mode,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
@@ -584,6 +593,7 @@ pub fn execute(
|
|||||||
"success": true,
|
"success": true,
|
||||||
"value": marqdo_value::to_wire(&outcome.value),
|
"value": marqdo_value::to_wire(&outcome.value),
|
||||||
"stdout": stdout_text,
|
"stdout": stdout_text,
|
||||||
|
"diagnostics": output::diagnostics_json(&project.diagnostics),
|
||||||
"trace": trace_entries,
|
"trace": trace_entries,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user