diff --git a/core/config/sharedConfig.ts b/core/config/sharedConfig.ts index 439925188..4032b6f43 100644 --- a/core/config/sharedConfig.ts +++ b/core/config/sharedConfig.ts @@ -19,6 +19,7 @@ export const sharedConfigSchema = z readResponseTTS: z.boolean(), promptPath: z.string(), useCurrentFileAsContext: z.boolean(), + logEditingData: z.boolean(), // `ui` in `ContinueConfig` showSessionTabs: z.boolean(), @@ -171,6 +172,9 @@ export function modifyAnyConfigWithSharedConfig< configCopy.experimental.useCurrentFileAsContext = sharedConfig.useCurrentFileAsContext; } + if (sharedConfig.logEditingData !== undefined) { + configCopy.experimental.logEditingData = sharedConfig.logEditingData; + } return configCopy; } diff --git a/core/index.d.ts b/core/index.d.ts index b0dace0f2..6cce48fb3 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1227,6 +1227,7 @@ export interface ContinueUIConfig { codeWrap?: boolean; showSessionTabs?: boolean; autoAcceptEditToolDiffs?: boolean; + logEditingData?: boolean; } export interface ContextMenuConfig { @@ -1368,6 +1369,11 @@ export interface ExperimentalConfig { * If enabled, will add the current file as context. */ useCurrentFileAsContext?: boolean; + + /** + * If enabled, will save data on the user's editing processes + */ + logEditingData?: boolean; } export interface AnalyticsConfig { diff --git a/extensions/vscode/src/extension/VsCodeExtension.ts b/extensions/vscode/src/extension/VsCodeExtension.ts index c63adf786..b3947c94c 100644 --- a/extensions/vscode/src/extension/VsCodeExtension.ts +++ b/extensions/vscode/src/extension/VsCodeExtension.ts @@ -291,13 +291,11 @@ export class VsCodeExtension { vscode.workspace.onDidChangeTextDocument(async (event) => { const changes = event.contentChanges; const editor = vscode.window.activeTextEditor; - if (!editor) { - return; - } + const { config } = await this.configHandler.loadConfig(); - if (event.contentChanges.length === 0) { - return; - } + if (!config?.experimental?.logEditingData) return; + if (!editor) return; + if (event.contentChanges.length === 0) return; const activeCursorPos = editor.selection.active; const editActions: RangeInFileWithNextEditInfo[] = changes.map( diff --git a/gui/src/pages/config/UserSettingsForm.tsx b/gui/src/pages/config/UserSettingsForm.tsx index 7f521b95f..c3fb90432 100644 --- a/gui/src/pages/config/UserSettingsForm.tsx +++ b/gui/src/pages/config/UserSettingsForm.tsx @@ -74,6 +74,7 @@ export function UserSettingsForm() { const showChatScrollbar = config.ui?.showChatScrollbar ?? false; const readResponseTTS = config.experimental?.readResponseTTS ?? false; const autoAcceptEditToolDiffs = config.ui?.autoAcceptEditToolDiffs ?? false; + const logEditingData = config.experimental?.logEditingData ?? false; const displayRawMarkdown = config.ui?.displayRawMarkdown ?? false; const disableSessionTitles = config.disableSessionTitles ?? false; const useCurrentFileAsContext = @@ -386,6 +387,27 @@ export function UserSettingsForm() { } text="Add Current File by Default" /> + + + handleUpdate({ + logEditingData: !logEditingData, + }) + } + text="Log Editing Data" + showIfToggled={ + <> + + + {`Only turn this on if you want to log your editing processes in addition to the normal dev data. Note that this will store a lot of data.`} + + + } + />