fix(#271): document name?, body_name? and targets? on the commands that accept them

sheet.flange now lists name?/body_name?, solid.loft and solid.sweep list
targets?/name?/body_name?, and the primitives list name?/body_name? (all go
through add_feature, which reads them). A test pins the shared keys for
every body-creating feature.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-12 10:07:10 -04:00
1 parent 879aacacf8
commit 87bb2f37f8
3 files changed
+26 -7

No files matched your search

+19
View File
@@ -2430,3 +2430,22 @@ fn params_docs_list_working_parameters() {
assert!(params("sheet.flange").contains("body_name"), "sheet.flange: {}", params("sheet.flange"));
assert!(params("solid.loft").contains("targets"), "solid.loft: {}", params("solid.loft"));
}
/// Every body-creating feature documents the keys `add_feature` reads for all of them (`name`,
/// `body_name`), and those that take `targets` say so (#271).
#[test]
fn feature_params_docs_list_shared_keys() {
let mut s = Session::default();
let cmds = run(&mut s, "engine.commands", json!({}));
let params =
|id: &str| cmds.as_array().unwrap().iter().find(|c| c["id"] == id).and_then(|c| c["params"].as_str()).unwrap_or_default().to_string();
let with_targets = ["solid.extrude", "solid.revolve", "solid.sweep", "solid.loft", "solid.pipe", "solid.coil"];
let without_targets = ["solid.box", "solid.cylinder", "solid.sphere", "solid.torus", "sheet.flange"];
for id in with_targets.iter().chain(&without_targets) {
let doc = params(id);
assert!(doc.contains("name?") && doc.contains("body_name?"), "{id}: {doc}");
}
for id in with_targets {
assert!(params(id).contains("targets?"), "{id}: {}", params(id));
}
}