diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 310fe556..d83b8132 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,7 +84,7 @@ Now that you're set up, feel free to check out our [Issues](https://github.com/v ## Bundling -We don't usually recommend bundling - instead, usually you should just build (above). To bundle Void into an executable app, run one of the following commands. This will create a folder named `VSCode-darwin-arm64` (or similar) in the repo's parent's directory. Be patient - compiling can take ~25 minutes. +We don't usually recommend bundling. Instead, you should probably just build (above). If you're sure you want to bundle Void into an executable app, run one of the following commands. This will create a folder named `VSCode-darwin-arm64` (or similar) in the repo's parent's directory. Be patient - compiling can take ~25 minutes. ### Mac - `npm run gulp vscode-darwin-arm64` - most common (Apple Silicon) diff --git a/src/vs/workbench/contrib/void/browser/getCmdKey.ts b/src/vs/workbench/contrib/void/browser/getCmdKey.ts index c1961814..b1e9edf0 100644 --- a/src/vs/workbench/contrib/void/browser/getCmdKey.ts +++ b/src/vs/workbench/contrib/void/browser/getCmdKey.ts @@ -3,10 +3,12 @@ * Void Editor additions licensed under the AGPL 3.0 License. *--------------------------------------------------------------------------------------------*/ -import { OperatingSystem, OS } from '../../../../base/common/platform.js'; +import { isMacintosh } from '../../../../base/common/platform'; +// import { OperatingSystem, OS } from '../../../../base/common/platform.js'; +// OS === OperatingSystem.Macintosh export function getCmdKey(): string { - if (OS === OperatingSystem.Macintosh) { + if (isMacintosh) { return '⌘'; } else { return 'Ctrl'; diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/ModelSelectionSettings.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/ModelSelectionSettings.tsx index 48f7be2c..c7f61fdf 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/ModelSelectionSettings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/ModelSelectionSettings.tsx @@ -49,9 +49,9 @@ export const ModelSelectionOfFeature = ({ featureName }: { featureName: FeatureN voidConfigService.setModelSelectionOfFeature(featureName, { providerName: newVal[0] as ProviderName, modelName: newVal[1] }) }, [voidConfigService, featureName, isDummy])} - // we are responsible for setting the initial state here + // we are responsible for setting the initial state here. always sync instance when state changes. onCreateInstance={useCallback((instance: SelectBox) => { - const updateInstance = () => { + const syncInstance = () => { const settingsAtProvider = voidConfigService.state.modelSelectionOfFeature[featureName] const index = modelOptions.findIndex(v => v.value[0] === settingsAtProvider?.providerName && v.value[1] === settingsAtProvider?.modelName) if (index !== -1) { @@ -60,8 +60,8 @@ export const ModelSelectionOfFeature = ({ featureName }: { featureName: FeatureN weChangedText = false } } - updateInstance() - const disposable = voidConfigService.onDidChangeState(updateInstance) + syncInstance() + const disposable = voidConfigService.onDidChangeState(syncInstance) return [disposable] }, [voidConfigService, modelOptions, featureName])} />} diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/VoidProviderSettings.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/VoidProviderSettings.tsx index 57fcf4e8..f85cc74e 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/VoidProviderSettings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/VoidProviderSettings.tsx @@ -36,18 +36,17 @@ const Setting = ({ providerName, settingName }: { providerName: ProviderName, se } }, [voidConfigService, providerName, settingName])} - // we are responsible for setting the initial value here + // we are responsible for setting the initial value. always sync the instance whenever there's a change to state. onCreateInstance={useCallback((instance: InputBox) => { - const updateInstance = () => { + const syncInstance = () => { const settingsAtProvider = voidConfigService.state.settingsOfProvider[providerName]; - // @ts-ignore - const stateVal = settingsAtProvider[settingName] + const stateVal = settingsAtProvider[settingName as keyof typeof settingsAtProvider] weChangedText = true - instance.value = stateVal + instance.value = stateVal as string weChangedText = false } - updateInstance() - const disposable = voidConfigService.onDidChangeState(updateInstance) + syncInstance() + const disposable = voidConfigService.onDidChangeState(syncInstance) return [disposable] }, [voidConfigService, providerName, settingName])} multiline={false}