|
| 1 | +# Concurrent File Edits |
| 2 | + |
| 3 | +Edit multiple files in a single operation, dramatically speeding up refactoring and multi-file changes. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## What It Does |
| 8 | + |
| 9 | +Concurrent File Edits allows Roo to modify multiple files in your workspace within a single request. Instead of approving each file edit individually, you review and approve all changes at once through a unified batch approval interface. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Why Use It |
| 14 | + |
| 15 | +**Traditional approach**: Sequential file edits requiring individual approvals |
| 16 | +- Edit file A → Approve |
| 17 | +- Edit file B → Approve |
| 18 | +- Edit file C → Approve |
| 19 | + |
| 20 | +**With Concurrent File Edits**: All changes presented together |
| 21 | +- Review all proposed changes across files A, B, and C |
| 22 | +- Approve once to apply all changes |
| 23 | + |
| 24 | +This reduces interruptions and speeds up complex tasks like: |
| 25 | +- Refactoring functions across multiple files |
| 26 | +- Updating configuration values throughout your codebase |
| 27 | +- Renaming components and their references |
| 28 | +- Applying consistent formatting or style changes |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## How to Enable |
| 33 | + |
| 34 | +1. Open VS Code Settings (Cmd/Ctrl + ,) |
| 35 | +2. Search for "experimental.MULTI_FILE_APPLY_DIFF" |
| 36 | +3. Enable the setting |
| 37 | +4. Restart VS Code for changes to take effect |
| 38 | + |
| 39 | +Or add to your settings.json: |
| 40 | +```json |
| 41 | +{ |
| 42 | + "roo.experimental.MULTI_FILE_APPLY_DIFF": true |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Using the Feature |
| 49 | + |
| 50 | +When enabled, Roo automatically uses concurrent edits when appropriate. You'll see a "Batch Diff Approval" interface showing: |
| 51 | + |
| 52 | +- All files to be modified |
| 53 | +- Proposed changes for each file |
| 54 | +- Options to approve all changes or review individually |
| 55 | + |
| 56 | +### Example Workflow |
| 57 | + |
| 58 | +1. Ask Roo to "Update all API endpoints to use the new authentication method" |
| 59 | +2. Roo analyzes your codebase and identifies all affected files |
| 60 | +3. You receive a single batch approval request showing changes across: |
| 61 | + - `src/api/users.js` |
| 62 | + - `src/api/products.js` |
| 63 | + - `src/api/orders.js` |
| 64 | + - `src/middleware/auth.js` |
| 65 | +4. Review all changes in the unified diff view |
| 66 | +5. Approve to apply all changes simultaneously |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## Technical Details |
| 71 | + |
| 72 | +This feature leverages the [`apply_diff`](/advanced-usage/available-tools/apply-diff#experimental-multi-file-edits-multi_file_apply_diff) tool's experimental multi-file capabilities. For detailed information about the implementation, XML format, and how the `MultiFileSearchReplaceDiffStrategy` works, see the [apply_diff documentation](/advanced-usage/available-tools/apply-diff#experimental-multi-file-edits-multi_file_apply_diff). |
| 73 | + |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## Best Practices |
| 78 | + |
| 79 | +### When to Enable |
| 80 | +- Using capable AI models (Claude 3.5 Sonnet, GPT-4, etc.) |
| 81 | +- Comfortable reviewing multiple changes at once |
| 82 | + |
| 83 | +### When to Keep Disabled |
| 84 | +- Working with less capable models that might struggle with complex multi-file contexts |
| 85 | +- Prefer reviewing each change individually |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Limitations |
| 90 | + |
| 91 | +- **Experimental**: This feature is still being refined and may have edge cases |
| 92 | +- **Model dependent**: Works best with more capable AI models |
| 93 | +- **Token usage**: Initial requests may use more tokens due to larger context |
| 94 | +- **Complexity**: Very large batch operations might be harder to review |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## Troubleshooting |
| 99 | + |
| 100 | +### Changes Not Batching |
| 101 | +- Verify the experimental flag is enabled in settings |
| 102 | +- Check that your model supports multi-file operations |
| 103 | +- Ensure files aren't restricted by `.rooignore` |
| 104 | + |
| 105 | +### Approval UI Not Appearing |
| 106 | +- Update to the latest version of Roo Code |
| 107 | +- Check VS Code's output panel for errors |
| 108 | +- Try disabling and re-enabling the feature |
| 109 | + |
| 110 | +### Performance Issues |
| 111 | +- For very large batches, consider breaking the task into smaller chunks |
| 112 | +- Monitor token usage if working with limited API quotas |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## See Also |
| 117 | + |
| 118 | +- [`apply_diff` Tool Documentation](/advanced-usage/available-tools/apply-diff) - Detailed technical information |
| 119 | +- [Experimental Features](/features/experimental/experimental-features) - Other experimental capabilities |
| 120 | +- [`.rooignore` Configuration](/features/rooignore) - File access restrictions |
0 commit comments