misc improvements

This commit is contained in:
Andrew Pareles 2024-12-14 17:51:07 -08:00
parent 9b427c78bf
commit 3991372f5b
4 changed files with 15 additions and 14 deletions

View file

@ -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)

View file

@ -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';

View file

@ -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])}
/>}

View file

@ -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}