diff --git a/core/commands/slash/edit.ts b/core/commands/slash/edit.ts index 00d1c00e4..5db8f96a3 100644 --- a/core/commands/slash/edit.ts +++ b/core/commands/slash/edit.ts @@ -552,6 +552,25 @@ const EditSlashCommand: SlashCommand = { } await sendDiffUpdate(lines, true); + + if (params?.recap) { + const prompt = `This is the code before editing: +\`\`\` +${contents} +\`\`\` + +This is the code after editing: + +\`\`\` +${lines.join("\n")} +\`\`\` + +Please briefly explain the changes made to the code above. Give no more than 2-3 sentences, and use markdown bullet points:`; + + for await (const update of llm.streamComplete(prompt)) { + yield update; + } + } }, }; diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 258401c49..5e63194ba 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -780,6 +780,27 @@ }, "required": ["params"] } + }, + { + "if": { + "properties": { + "name": { + "enum": ["edit"] + } + } + }, + "then": { + "properties": { + "params": { + "properties": { + "recap": { + "type": "boolean", + "description": "If recap is set to `true`, Continue will generate a summary of the changes after making the edit." + } + } + } + } + } } ], "required": ["name", "description"] diff --git a/extensions/vscode/src/ideProtocol.ts b/extensions/vscode/src/ideProtocol.ts index edf828df1..933948e6a 100644 --- a/extensions/vscode/src/ideProtocol.ts +++ b/extensions/vscode/src/ideProtocol.ts @@ -58,6 +58,9 @@ class VsCodeIde implements IDE { const configPath = getConfigJsonPath(); let contents = fs.readFileSync(configPath, "utf8"); let config = JSON.parse(contents) as SerializedContinueConfig; + if (config.allowAnonymousTelemetry === undefined) { + config.allowAnonymousTelemetry = true; + } config.allowAnonymousTelemetry = config.allowAnonymousTelemetry && vscode.workspace.getConfiguration("continue").get("telemetryEnabled");