Appearance
Large File Refactoring
CodePanda includes a feature that automatically detects large files in your codebase. CodePanda will suggest breaking them down into smaller files to help make the code more maintainable.
Why Refactor Large Files?
Working with large files creates several challenges:
- Higher Error Rate: CodePanda is more likely to make mistakes when generating changes to very large files
- Slower Response Times: Processing large files takes significantly more time and tokens
- Higher Token Costs: Large files consume more tokens for context, increasing API costs
- Reduced Context Window: Large files take up valuable space in CodePanda's limited context window
- Harder to Understand: CodePanda can better understand and modify smaller, focused files
How CodePanda Helps
CodePanda automatically:
- Detects Large Files: Identifies any file with more than 450 lines of code during editing
- Provides Notifications: Shows an alert indicator in the chat interface
- Offers Assistance: Upon your request, helps restructure the code into smaller, more focused modules
Using the Large File Refactoring Feature
When CodePanda detects large files:
- A yellow alert triangle icon will appear in the bottom left of the chat input area
- Click the icon to view a dialog showing all detected large files and their line counts
- You can:
- Close: Dismiss the dialog without action
- Clear Alerts: Dismiss the notifications without refactoring
- Refactor: Ask CodePanda to help restructure the large files
CodePanda will never refactor your code without your explicit request. The refactoring process only begins when you choose the "Refactor" option.