Skip to main content

Module move_item

Module move_item 

Source
Expand description

Move recipe: relocate a symbol’s definition to another file and rewrite imports.

Steps:

  1. Locate the symbol in the source file
  2. Extract its definition text via the editor
  3. Append the definition to the destination file
  4. Delete the definition from the source file
  5. Rewrite import statements in every file that imported it from the old module path (best-effort: emits a warning and skips when the new path can’t be derived)
  6. Optionally leave a re-export in the source file (--reexport)

Structs§

MoveOutcome
Outcome details for a planned move (used by callers that want a richer report than RefactoringPlan alone).

Functions§

plan_move
Build a move plan without touching the filesystem.