Use Continue for a Large Codebase Refactor
Refactoring across many files is error-prone. Continue's codebase awareness helps you do it safely.
Prerequisites
- Continue installed in VS Code or JetBrains
- Ollama, LM Studio, or OpenAI connected
- A codebase with a clear refactor goal
Step 1: Index the codebase
Continue indexes your project for context. Give it a moment to scan. For large repos, you may need to focus on specific folders.
Step 2: Describe the refactor
In the chat: "We're renaming [OldName] to [NewName] across the codebase. Update all references. Preserve behavior. List every file you change."
Or: "Migrate from [old library] to [new library]. Update imports, API calls, and tests. Run tests after."
Step 3: Review changes
Continue will suggest edits. Review each one. Check for: wrong renames, broken imports, missing updates. Accept or reject. Don't blindly apply everything.
Step 4: Use inline edit for targeted changes
For a single file, select the block to change. Cmd+K (Mac) or Ctrl+K (Win). "Replace this with the async version" or "Add error handling here." Faster than full-file edits.
Step 5: Run tests
After applying changes, run your test suite. Fix any failures. Continue can help: "The test X is failing. Here's the error. Fix it."
Tips
- Break large refactors into smaller steps. "First update the core module, then the consumers."
- Use local models (Ollama) for privacy if the codebase is proprietary.
- Always run tests and lint before committing.
Discussion
Sign in to comment. Your account must be at least 1 day old.