Documentation
¶
Overview ¶
Package changesig is the change-signature engine: it adds, removes, or renames a parameter on a function/method and rewrites every call site across the module. It is importable by the CLI, the MCP server, and other library callers without pulling in package main.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply applies edits grouped per file (descending offset so earlier offsets stay valid), parse-checks every result before writing, then runs goimports on each touched file.
func EditedFiles ¶
EditedFiles returns the distinct files touched by edits, sorted.
Types ¶
type Action ¶
type Action struct {
Kind string // "add" | "remove" | "rename"
ParamName string
ParamType string
Position int // -1 = append at end
CallValue string
RemoveRef string // name or 0-based index
OldName string
NewName string
}
Action is the parsed --add-param/--remove-param/--rename-param request. The CLI wrapper builds it from flags; the engine consumes it in Plan.
type TextEdit ¶
type TextEdit struct {
// contains filtered or unexported fields
}
TextEdit is a byte-range replacement in a file. Offsets come from the shared token.FileSet of a packages.Load run.
func Plan ¶
Plan loads and type-checks the module containing file, locates the target function/method named by locator, and computes the text edits (plus a human-readable detail string) that apply action to it and every call site. It performs the same refusals the CLI relies on (missing target, generic functions, unsafe call sites, interface satisfaction) as classified errors.