diff --git a/.voidrules b/.voidrules index 6c655134..fe8403df 100644 --- a/.voidrules +++ b/.voidrules @@ -12,3 +12,5 @@ Do not add or remove semicolons to any of my files. Just go with convention and Never modify files outside src/vs/workbench/contrib/void without consulting with the user first. All types that map from a value A to B should be called bOfA. For example, if you create a hashmap that goes from toolId to toolName, it should be called toolNameOfToolId, etc. + +No need to check that it compiles by running compile, just stop. diff --git a/src/vs/workbench/contrib/void/browser/editCodeService.ts b/src/vs/workbench/contrib/void/browser/editCodeService.ts index 96e3bf6d..3eb7ed6b 100644 --- a/src/vs/workbench/contrib/void/browser/editCodeService.ts +++ b/src/vs/workbench/contrib/void/browser/editCodeService.ts @@ -1179,6 +1179,11 @@ class EditCodeService extends Disposable implements IEditCodeService { this._onDidChangeStreamingInDiffZone.fire({ uri, diffareaid: diffZone.diffareaid }) this._refreshStylesAndDiffsInURI(uri) onFinishEdit() + + // auto accept + if (this._settingsService.state.globalSettings.autoAcceptLLMChanges) { + this.acceptOrRejectAllDiffAreas({ uri, removeCtrlKs: false, behavior: 'accept', _addToHistory: false }) + } } @@ -1218,6 +1223,11 @@ class EditCodeService extends Disposable implements IEditCodeService { this._onDidChangeStreamingInDiffZone.fire({ uri, diffareaid: diffZone.diffareaid }) this._refreshStylesAndDiffsInURI(uri) onFinishEdit() + + // auto accept + if (this._settingsService.state.globalSettings.autoAcceptLLMChanges) { + this.acceptOrRejectAllDiffAreas({ uri, removeCtrlKs: false, behavior: 'accept', _addToHistory: false }) + } } this._writeURIText(uri, newContent, 'wholeFileRange', { shouldRealignDiffAreas: true }) @@ -1448,6 +1458,11 @@ class EditCodeService extends Disposable implements IEditCodeService { } this._refreshStylesAndDiffsInURI(uri) onFinishEdit() + + // auto accept + if (this._settingsService.state.globalSettings.autoAcceptLLMChanges) { + this.acceptOrRejectAllDiffAreas({ uri, removeCtrlKs: false, behavior: 'accept', _addToHistory: false }) + } } // throws @@ -1732,6 +1747,11 @@ class EditCodeService extends Disposable implements IEditCodeService { this._deleteTrackingZone(trackingZone) onFinishEdit() + + // auto accept + if (this._settingsService.state.globalSettings.autoAcceptLLMChanges) { + this.acceptOrRejectAllDiffAreas({ uri, removeCtrlKs: false, behavior: 'accept', _addToHistory: false }) + } } const onError = (e: { message: string; fullError: Error | null; }) => { diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx index 429af0e1..c8ba4da4 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx @@ -1319,6 +1319,18 @@ export const Settings = () => { {settingsState.globalSettings.includeToolLintErrors ? 'Fix lint errors' : `Fix lint errors`} + + {/* Auto Accept LLM Changes Switch */} + +
+ voidSettingsService.setGlobalSetting('autoAcceptLLMChanges', newVal)} + /> + Auto-accept LLM changes +
+
diff --git a/src/vs/workbench/contrib/void/common/voidSettingsService.ts b/src/vs/workbench/contrib/void/common/voidSettingsService.ts index dbd3cf3f..3e0c2295 100644 --- a/src/vs/workbench/contrib/void/common/voidSettingsService.ts +++ b/src/vs/workbench/contrib/void/common/voidSettingsService.ts @@ -289,6 +289,9 @@ class VoidSettingsService extends Disposable implements IVoidSettingsService { } // add disableSystemMessage feature if (readS.globalSettings.disableSystemMessage === undefined) readS.globalSettings.disableSystemMessage = false; + + // add autoAcceptLLMChanges feature + if (readS.globalSettings.autoAcceptLLMChanges === undefined) readS.globalSettings.autoAcceptLLMChanges = false; } catch (e) { readS = defaultState() diff --git a/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts b/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts index 90ac77eb..549b6534 100644 --- a/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts +++ b/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts @@ -454,6 +454,7 @@ export type GlobalSettings = { includeToolLintErrors: boolean; isOnboardingComplete: boolean; disableSystemMessage: boolean; + autoAcceptLLMChanges: boolean; } export const defaultGlobalSettings: GlobalSettings = { @@ -469,6 +470,7 @@ export const defaultGlobalSettings: GlobalSettings = { includeToolLintErrors: true, isOnboardingComplete: false, disableSystemMessage: false, + autoAcceptLLMChanges: false, } export type GlobalSettingName = keyof GlobalSettings