change_signature
Add, remove, or reorder a method's parameters and update all call sites, cascading to overrides and interface implementations. Requires explicit call site values for added parameters.
Instructions
Add, remove, or reorder a method's parameters and update every call site (Roslyn's own change-signature engine). Cascades to overrides and interface implementations, rewrites named and optional arguments, and preserves an extension method's this parameter; the overrides and implementations it also rewrote are listed in CascadedTo. Operations apply in order: remove drops parameter; reorder takes order, a full permutation of the parameters surviving at that point; add appends name plus type and REQUIRES callSiteValue — the expression every existing call site will pass, since the tool never guesses call-site semantics — with an optional defaultValue that instead makes the parameter optional and leaves existing calls untouched. Rejected as unsafe: an added name that is not a valid C# identifier or collides with an existing parameter; a type that does not resolve, or resolves ambiguously (qualify it); moving or removing an extension method's this parameter (it must stay first); and any signature that would leave a surviving params array anywhere but last — add the parameter and reorder it before the params array, or remove that array. Defaults to preview mode (returns edits without writing files); set preview=false to apply. New compiler errors the change would introduce are reported as Conflicts, and apply mode refuses to write them unless force=true. Source-defined methods only; overloaded names must be disambiguated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Apply even when Conflicts are reported (default: false) | |
| method | Yes | Method to change: `MyClass.MyMethod` or fully qualified `Namespace.MyClass.MyMethod` | |
| preview | No | Preview only — return edits without writing to disk (default: true) | |
| operations | Yes | Parameter edits applied in order. Each has `kind` (`remove`, `reorder` or `add`) plus: `parameter` for `remove`; `order` for `reorder`; `name`, `type`, `callSiteValue` and optional `defaultValue` for `add` |