From 8f3a7525624b09fbcdc052a288db4e532eb308a3 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 14 Mar 2025 00:41:17 -0700 Subject: [PATCH] sync fast apply to chat --- .../react/src/void-settings-tsx/Settings.tsx | 22 ++++++++++++++----- .../void/common/voidSettingsService.ts | 12 ++++++++++ .../contrib/void/common/voidSettingsTypes.ts | 3 ++- 3 files changed, 31 insertions(+), 6 deletions(-) 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 346d9143..3eb18fe6 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 @@ -444,11 +444,11 @@ export const FeaturesTab = () => {

Feature Options

-
+

{displayInfoOfFeatureName('Autocomplete')}

Experimental. Only works with models that support FIM.
-
+
{ {voidSettingsState.globalSettings.enableAutocomplete ? 'Enabled' : 'Disabled'}
-
+

{displayInfoOfFeatureName('Apply')}

-
We recommend using Claude 3.7 or GPT 4o.
- +
If you customize this, we recommend using Claude 3.7 or DeepSeek R1.
+
+ voidSettingsService.setGlobalSetting('syncFastApplyToChat', !newVal)} + /> + {voidSettingsState.globalSettings.syncFastApplyToChat ? 'Sync with Chat' : 'Use Another Model'} +
+ +
+ +
+
diff --git a/src/vs/workbench/contrib/void/common/voidSettingsService.ts b/src/vs/workbench/contrib/void/common/voidSettingsService.ts index 278d63da..92940f92 100644 --- a/src/vs/workbench/contrib/void/common/voidSettingsService.ts +++ b/src/vs/workbench/contrib/void/common/voidSettingsService.ts @@ -273,6 +273,13 @@ class VoidSettingsService extends Disposable implements IVoidSettingsService { } + private _onUpdate_syncFastApplyToChat() { + // if sync is turned on, sync (call this whenever Chat model or !!sync changes) + if (this.state.globalSettings.syncFastApplyToChat) { + this.setModelSelectionOfFeature('Apply', deepClone(this.state.modelSelectionOfFeature['Chat'])) + } + } + setGlobalSetting: SetGlobalSettingFn = async (settingName, newVal) => { const newState: VoidSettingsState = { ...this.state, @@ -285,6 +292,8 @@ class VoidSettingsService extends Disposable implements IVoidSettingsService { await this._storeState() this._onDidChangeState.fire() + // hooks + this._onUpdate_syncFastApplyToChat() } @@ -301,6 +310,9 @@ class VoidSettingsService extends Disposable implements IVoidSettingsService { await this._storeState() this._onDidChangeState.fire() + + // hooks + if (featureName === 'Chat') { this._onUpdate_syncFastApplyToChat() } } diff --git a/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts b/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts index 639a3fae..01b07d65 100644 --- a/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts +++ b/src/vs/workbench/contrib/void/common/voidSettingsTypes.ts @@ -385,13 +385,14 @@ export type GlobalSettings = { autoRefreshModels: boolean; aiInstructions: string; enableAutocomplete: boolean; + syncFastApplyToChat: boolean; } export const defaultGlobalSettings: GlobalSettings = { autoRefreshModels: true, aiInstructions: '', enableAutocomplete: false, - + syncFastApplyToChat: true, } export type GlobalSettingName = keyof GlobalSettings