Codegen provides fast, configurable and safe APIs for moving symbols (functions, classes, variables) between files while automatically handling imports and dependencies. The key API is Symbol.move_to_file(…).Documentation Index
Fetch the complete documentation index at: https://codegeninc-fix-system-prompt-typo.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Basic Symbol Movement
Simply call Symbol.move_to_file(…) to move a symbol to a new file.By default, this will move any dependencies, including imports, to the new
file.
Moving Strategies
The Symbol.move_to_file(…) method accepts astrategy parameter, which can be used to control how imports are updated.
Your options are:
"update_all_imports": Updates all import statements across the codebase (default)"add_back_edge": Adds import and re-export in the original file
"add_back_edge" is useful when moving a symbol that is depended on by other symbols in the original file, and will result in smaller diffs.