+
{ modelNameRef.current = modelName }, [])}
@@ -125,36 +128,33 @@ const AddModelMenu = ({ onSubmit }: { onSubmit: () => void }) => {
{/* button */}
-
+ }}
+ >Add model
{!errorString ? null :
{errorString}
}
-
-
>
@@ -167,10 +167,7 @@ const AddModelMenuFull = () => {
return
{open ?
{ setOpen(false) }} />
- :
+ : setOpen(true)}>Add Model
}
}
@@ -432,11 +429,94 @@ export const FeaturesTab = () => {
+// https://github.com/VSCodium/vscodium/blob/master/docs/index.md#migrating-from-visual-studio-code-to-vscodium
+// https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed
+type TransferFilesInfo = { from: URI, to: URI }[]
+const transferTheseFilesOfOS = (os: 'mac' | 'windows' | 'linux' | null): TransferFilesInfo => {
+ if (os === null)
+ throw new Error(`One-click switch is not possible in this environment.`)
+ if (os === 'mac') {
+ const homeDir = env['HOME']
+ if (!homeDir) throw new Error(`$HOME not found`)
+ return [{
+ from: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, 'Library', 'Application Support', 'Code', 'User', 'settings.json'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, 'Library', 'Application Support', 'Void', 'User', 'settings.json'),
+ }, {
+ from: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, 'Library', 'Application Support', 'Code', 'User', 'keybindings.json'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, 'Library', 'Application Support', 'Void', 'User', 'keybindings.json'),
+ }, {
+ from: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.vscode', 'extensions'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.void-editor', 'extensions'),
+ }]
+ }
+ if (os === 'linux') {
+ const homeDir = env['HOME']
+ if (!homeDir) throw new Error(`variable for $HOME location not found`)
+ return [{
+ from: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.config', 'Code', 'User', 'settings.json'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.config', 'Void', 'User', 'settings.json'),
+ }, {
+ from: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.config', 'Code', 'User', 'keybindings.json'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.config', 'Void', 'User', 'keybindings.json'),
+ }, {
+ from: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.vscode', 'extensions'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), homeDir, '.void-editor', 'extensions'),
+ }]
+ }
+ if (os === 'windows') {
+ const appdata = env['APPDATA']
+ if (!appdata) throw new Error(`variable for %APPDATA% location not found`)
+ const userprofile = env['USERPROFILE']
+ if (!userprofile) throw new Error(`variable for %USERPROFILE% location not found`)
+
+ return [{
+ from: URI.joinPath(URI.from({ scheme: 'file' }), appdata, 'Code', 'User', 'settings.json'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), appdata, 'Void', 'User', 'settings.json'),
+ }, {
+ from: URI.joinPath(URI.from({ scheme: 'file' }), appdata, 'Code', 'User', 'keybindings.json'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), appdata, 'Void', 'User', 'keybindings.json'),
+ }, {
+ from: URI.joinPath(URI.from({ scheme: 'file' }), userprofile, '.vscode', 'extensions'),
+ to: URI.joinPath(URI.from({ scheme: 'file' }), userprofile, '.void-editor', 'extensions'),
+ }]
+ }
+
+ throw new Error(`os '${os}' not recognized`)
+}
+
+const os = null//isWindows ? 'windows' : isMacintosh ? 'mac' : isLinux ? 'linux' : null
+let transferTheseFiles: TransferFilesInfo = []
+let transferError: string | null = null
+
+try { transferTheseFiles = transferTheseFilesOfOS(os) }
+catch (e) { transferError = e + '' }
const OneClickSwitch = () => {
+ const accessor = useAccessor()
+ const fileService = accessor.get('IFileService')
+ if (transferTheseFiles.length === 0)
+ return <>
+
One-click transfer not available.
+
{transferError}
+ >
+
+ const onClick = async () => {
+ for (let { from, to } of transferTheseFiles) {
+ console.log('transferring', from, to)
+ // not sure if this can fail, just wrapping it with try/catch for now
+ try { await fileService.copy(from, to, true) }
+ catch (e) { console.error('Void Transfer Error:', e) }
+ }
+ }
+
+ return <>
+
+ Transfer Settings
+
+ >
}
@@ -446,21 +526,22 @@ const GeneralTab = () => {
{/* keyboard shortcuts */}
-
General Settings
+
General Settings
{`VS Code's built-in settings.`}
-
Keyboard Settings
+
Keyboard Settings
{`Void can access models from Anthropic, OpenAI, OpenRouter, and more.`}
-
One-click Switch
-
- Transfer your VS Code settings to Void.
-
-
Theme
+
One-click Switch
+
{`Transfer your VS Code settings into Void.`}
+
-
Rules for AI
+
Theme
+
+
+
Rules for AI
{/* placeholder: "Do not add ;'s. Do not change or delete spacing, formatting, or comments. Respond to queries in French when applicable. " */}
>