Remove Feature
remove_featureUse this when you need to remove a feature line from a script. Remove a single line from a kernelCAD script identified by a substring match. Returns the modified code plus diagnostics from re-evaluating. Refuses to remove the line containing the return statement. Side-effect-free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The .kcad.ts source code. | |
| match | Yes | A substring that uniquely identifies the line to remove (e.g. `const hole = cylinder(5,`). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the edit applied and re-evaluated cleanly. | |
| error | No | Failure message (present when ok is false). | |
| new_code | No | Modified .kcad.ts source (present on success). Caller persists it. | |
| diagnostics | No | Diagnostics from re-evaluating the modified source. | |
| binding_name | No | JS const name bound to the new construct (when one was created). |