Mass refactoring ( P42 Pro feature) allows you to quickly modernize hundreds and thousands of files.
For files and folders in the Explorer, there is a "Mass Refactor... [P42 Pro]" command that refactors files and folders in one go. You can choose a refactoring from a dialog. The selected file or all files in the folder (and its subfolders) are then refactored with the chosen refactoring. This means that all suggestions that this refactoring produces are applied.
💡 You can configure excluded path patterns to prevent specific folders and files from being updated by a mass refactoring.
- Get your workspace in a clean state, e.g., by committing or stashing your current changes or by switching to a clean branch.
- Run the refactoring on the folders you want to update.
- Thoroughly review the individual changes in the diff viewer and revert or fix them as needed. Modernizations need to cover many edge cases, so there is a chance that some changes may lose comments, break formatting, or affect the semantics. The P42 output log will also contain warnings for unsafe refactorings (see Safety Analysis). If you find bugs, please report them here: https://github.com/p42ai/refactor-vscode/issues
- Run your test suites to ensure nothing broke unexpectedly.
- Commit the changes.