Skip to content

Commit

Permalink
Add a search-and-replace diff strategy (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubens authored Dec 10, 2024
1 parent 7f764f6 commit 6e1f683
Show file tree
Hide file tree
Showing 7 changed files with 692 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Roo Cline Changelog

## [2.1.17]

- Switch to search/replace diffs in experimental diff editing mode

## [2.1.16]

- Allow copying prompts from the history screen

## [2.1.15]

- Incorporate dbasclpy's [PR](https://github.com/RooVetGit/Roo-Cline/pull/54) to add support for gemini-exp-1206
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ A fork of Cline, an autonomous coding agent, with some added experimental config
- Auto-approval capabilities for commands, write, and browser operations
- Support for .clinerules per-project custom instructions
- Ability to run side-by-side with Cline
- Code is unit-tested
- Unit test coverage (written almost entirely by Roo Cline!)
- Support for playing sound effects
- Support for OpenRouter compression
- Support for editing through diffs (very experimental)
- Support for gemini-exp-1206
- Support for copying prompts from the history screen

Here's an example of Roo-Cline autonomously creating a snake game with "Always approve write operations" and "Always approve browser actions" turned on:

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Roo Cline",
"description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.",
"publisher": "RooVeterinaryInc",
"version": "2.1.16",
"version": "2.1.17",
"icon": "assets/icons/rocket.png",
"galleryBanner": {
"color": "#617A91",
Expand Down
8 changes: 4 additions & 4 deletions src/core/diff/DiffStrategy.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { DiffStrategy } from './types'
import { UnifiedDiffStrategy } from './strategies/unified'

import { SearchReplaceDiffStrategy } from './strategies/search-replace'
/**
* Get the appropriate diff strategy for the given model
* @param model The name of the model being used (e.g., 'gpt-4', 'claude-3-opus')
* @returns The appropriate diff strategy for the model
*/
export function getDiffStrategy(model: string): DiffStrategy {
// For now, return UnifiedDiffStrategy for all models
// For now, return SearchReplaceDiffStrategy for all models
// This architecture allows for future optimizations based on model capabilities
return new UnifiedDiffStrategy()
return new SearchReplaceDiffStrategy()
}

export type { DiffStrategy }
export { UnifiedDiffStrategy }
export { UnifiedDiffStrategy, SearchReplaceDiffStrategy }
Loading

0 comments on commit 6e1f683

Please sign in to comment.