mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Remove the experimental unified diff (#2246)
This commit is contained in:
parent
e050043e58
commit
3d53386f1e
14 changed files with 11 additions and 47 deletions
5
.changeset/popular-teachers-brush.md
Normal file
5
.changeset/popular-teachers-brush.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"roo-cline": patch
|
||||
---
|
||||
|
||||
Remove the experimental unified diff
|
||||
|
|
@ -47,9 +47,8 @@ export const rooCodeDefaults: RooCodeSettings = {
|
|||
diffEnabled: true,
|
||||
fuzzyMatchThreshold: 1.0,
|
||||
experiments: {
|
||||
experimentalDiffStrategy: false, // unified diff
|
||||
multi_search_and_replace: false, // multi-line search and replace
|
||||
search_and_replace: true, // single-line search and replace
|
||||
multi_search_and_replace: false,
|
||||
search_and_replace: true,
|
||||
insert_content: false,
|
||||
powerSteering: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -271,7 +271,6 @@ export type CustomSupportPrompts = z.infer<typeof customSupportPromptsSchema>
|
|||
*/
|
||||
|
||||
export const experimentIds = [
|
||||
"experimentalDiffStrategy",
|
||||
"search_and_replace",
|
||||
"insert_content",
|
||||
"powerSteering",
|
||||
|
|
@ -287,7 +286,6 @@ export type ExperimentId = z.infer<typeof experimentIdsSchema>
|
|||
*/
|
||||
|
||||
const experimentsSchema = z.object({
|
||||
experimentalDiffStrategy: z.boolean(),
|
||||
search_and_replace: z.boolean(),
|
||||
insert_content: z.boolean(),
|
||||
powerSteering: z.boolean(),
|
||||
|
|
|
|||
|
|
@ -20,6 +20,4 @@ type GetDiffStrategyOptions = {
|
|||
}
|
||||
|
||||
export const getDiffStrategy = ({ fuzzyMatchThreshold, experiments }: GetDiffStrategyOptions): DiffStrategy =>
|
||||
experiments[EXPERIMENT_IDS.DIFF_STRATEGY_UNIFIED]
|
||||
? new NewUnifiedDiffStrategy(fuzzyMatchThreshold)
|
||||
: new MultiSearchReplaceDiffStrategy(fuzzyMatchThreshold)
|
||||
new MultiSearchReplaceDiffStrategy(fuzzyMatchThreshold)
|
||||
|
|
|
|||
|
|
@ -1190,7 +1190,7 @@ describe("ClineProvider", () => {
|
|||
}),
|
||||
}))
|
||||
|
||||
// Mock getState to return experimentalDiffStrategy, diffEnabled and fuzzyMatchThreshold
|
||||
// Mock getState to return diffEnabled and fuzzyMatchThreshold
|
||||
jest.spyOn(provider, "getState").mockResolvedValue({
|
||||
apiConfiguration: {
|
||||
apiProvider: "openrouter",
|
||||
|
|
@ -1202,7 +1202,6 @@ describe("ClineProvider", () => {
|
|||
enableMcpServerCreation: true,
|
||||
mcpEnabled: false,
|
||||
browserViewportSize: "900x600",
|
||||
experimentalDiffStrategy: true,
|
||||
diffEnabled: true,
|
||||
fuzzyMatchThreshold: 0.8,
|
||||
experiments: experimentDefault,
|
||||
|
|
@ -1259,7 +1258,6 @@ describe("ClineProvider", () => {
|
|||
mode: "code",
|
||||
mcpEnabled: false,
|
||||
browserViewportSize: "900x600",
|
||||
experimentalDiffStrategy: true,
|
||||
diffEnabled: false,
|
||||
fuzzyMatchThreshold: 0.8,
|
||||
experiments: experimentDefault,
|
||||
|
|
|
|||
|
|
@ -1253,13 +1253,6 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We
|
|||
|
||||
await provider.updateGlobalState("experiments", updatedExperiments)
|
||||
|
||||
const currentCline = provider.getCurrentCline()
|
||||
|
||||
// Update diffStrategy in current Cline instance if it exists.
|
||||
if (message.values[EXPERIMENT_IDS.DIFF_STRATEGY_UNIFIED] !== undefined && currentCline) {
|
||||
await currentCline.updateDiffStrategy(updatedExperiments)
|
||||
}
|
||||
|
||||
await provider.postStateToWebview()
|
||||
break
|
||||
}
|
||||
|
|
|
|||
1
src/exports/roo-code.d.ts
vendored
1
src/exports/roo-code.d.ts
vendored
|
|
@ -253,7 +253,6 @@ type GlobalSettings = {
|
|||
experiments?:
|
||||
| {
|
||||
search_and_replace: boolean
|
||||
experimentalDiffStrategy: boolean
|
||||
insert_content: boolean
|
||||
powerSteering: boolean
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ type GlobalSettings = {
|
|||
experiments?:
|
||||
| {
|
||||
search_and_replace: boolean
|
||||
experimentalDiffStrategy: boolean
|
||||
insert_content: boolean
|
||||
powerSteering: boolean
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,12 +274,7 @@ export type CustomSupportPrompts = z.infer<typeof customSupportPromptsSchema>
|
|||
* ExperimentId
|
||||
*/
|
||||
|
||||
export const experimentIds = [
|
||||
"search_and_replace",
|
||||
"experimentalDiffStrategy",
|
||||
"insert_content",
|
||||
"powerSteering",
|
||||
] as const
|
||||
export const experimentIds = ["search_and_replace", "insert_content", "powerSteering"] as const
|
||||
|
||||
export const experimentIdsSchema = z.enum(experimentIds)
|
||||
|
||||
|
|
@ -291,7 +286,6 @@ export type ExperimentId = z.infer<typeof experimentIdsSchema>
|
|||
|
||||
const experimentsSchema = z.object({
|
||||
search_and_replace: z.boolean(),
|
||||
experimentalDiffStrategy: z.boolean(),
|
||||
insert_content: z.boolean(),
|
||||
powerSteering: z.boolean(),
|
||||
})
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ describe("experiments", () => {
|
|||
it("returns false when experiment is not enabled", () => {
|
||||
const experiments: Record<ExperimentId, boolean> = {
|
||||
powerSteering: false,
|
||||
experimentalDiffStrategy: false,
|
||||
search_and_replace: false,
|
||||
insert_content: false,
|
||||
}
|
||||
|
|
@ -24,7 +23,6 @@ describe("experiments", () => {
|
|||
it("returns true when experiment is enabled", () => {
|
||||
const experiments: Record<ExperimentId, boolean> = {
|
||||
powerSteering: true,
|
||||
experimentalDiffStrategy: false,
|
||||
search_and_replace: false,
|
||||
insert_content: false,
|
||||
}
|
||||
|
|
@ -33,7 +31,6 @@ describe("experiments", () => {
|
|||
|
||||
it("returns false when experiment is not present", () => {
|
||||
const experiments: Record<ExperimentId, boolean> = {
|
||||
experimentalDiffStrategy: false,
|
||||
search_and_replace: false,
|
||||
insert_content: false,
|
||||
powerSteering: false,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import { AssertEqual, Equals, Keys, Values } from "../utils/type-fu"
|
|||
export type { ExperimentId }
|
||||
|
||||
export const EXPERIMENT_IDS = {
|
||||
DIFF_STRATEGY_UNIFIED: "experimentalDiffStrategy",
|
||||
INSERT_BLOCK: "insert_content",
|
||||
SEARCH_AND_REPLACE: "search_and_replace",
|
||||
POWER_STEERING: "powerSteering",
|
||||
|
|
@ -19,7 +18,6 @@ interface ExperimentConfig {
|
|||
}
|
||||
|
||||
export const experimentConfigsMap: Record<ExperimentKey, ExperimentConfig> = {
|
||||
DIFF_STRATEGY_UNIFIED: { enabled: false },
|
||||
INSERT_BLOCK: { enabled: false },
|
||||
SEARCH_AND_REPLACE: { enabled: false },
|
||||
POWER_STEERING: { enabled: false },
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@ import { useAppTranslation } from "@/i18n/TranslationContext"
|
|||
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
|
||||
import { Cog } from "lucide-react"
|
||||
|
||||
import { EXPERIMENT_IDS, ExperimentId } from "../../../../src/shared/experiments"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { Slider } from "@/components/ui"
|
||||
|
||||
import { SetCachedStateField, SetExperimentEnabled } from "./types"
|
||||
import { SetCachedStateField } from "./types"
|
||||
import { SectionHeader } from "./SectionHeader"
|
||||
import { Section } from "./Section"
|
||||
|
||||
|
|
@ -17,16 +15,12 @@ type AdvancedSettingsProps = HTMLAttributes<HTMLDivElement> & {
|
|||
diffEnabled?: boolean
|
||||
fuzzyMatchThreshold?: number
|
||||
setCachedStateField: SetCachedStateField<"rateLimitSeconds" | "diffEnabled" | "fuzzyMatchThreshold">
|
||||
experiments: Record<ExperimentId, boolean>
|
||||
setExperimentEnabled: SetExperimentEnabled
|
||||
}
|
||||
export const AdvancedSettings = ({
|
||||
rateLimitSeconds,
|
||||
diffEnabled,
|
||||
fuzzyMatchThreshold,
|
||||
setCachedStateField,
|
||||
experiments,
|
||||
setExperimentEnabled,
|
||||
className,
|
||||
...props
|
||||
}: AdvancedSettingsProps) => {
|
||||
|
|
@ -66,10 +60,6 @@ export const AdvancedSettings = ({
|
|||
checked={diffEnabled}
|
||||
onChange={(e: any) => {
|
||||
setCachedStateField("diffEnabled", e.target.checked)
|
||||
if (!e.target.checked) {
|
||||
// Reset experimental strategies when diffs are disabled.
|
||||
setExperimentEnabled(EXPERIMENT_IDS.DIFF_STRATEGY_UNIFIED, false)
|
||||
}
|
||||
}}>
|
||||
<span className="font-medium">{t("settings:advanced.diff.label")}</span>
|
||||
</VSCodeCheckbox>
|
||||
|
|
|
|||
|
|
@ -482,8 +482,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
|
|||
diffEnabled={diffEnabled}
|
||||
fuzzyMatchThreshold={fuzzyMatchThreshold}
|
||||
setCachedStateField={setCachedStateField}
|
||||
setExperimentEnabled={setExperimentEnabled}
|
||||
experiments={experiments}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,6 @@ describe("mergeExtensionState", () => {
|
|||
...baseState,
|
||||
apiConfiguration: { modelMaxTokens: 1234, modelMaxThinkingTokens: 123 },
|
||||
experiments: {
|
||||
experimentalDiffStrategy: true,
|
||||
search_and_replace: true,
|
||||
insert_content: true,
|
||||
} as Record<ExperimentId, boolean>,
|
||||
|
|
@ -232,7 +231,6 @@ describe("mergeExtensionState", () => {
|
|||
})
|
||||
|
||||
expect(result.experiments).toEqual({
|
||||
experimentalDiffStrategy: true,
|
||||
search_and_replace: true,
|
||||
insert_content: true,
|
||||
powerSteering: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue