From 382ecaae1b1be42ea51f75009a1d5d60561ae0e8 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 00:34:42 -0700 Subject: [PATCH] auto format --- .../react/src/void-settings-tsx/Settings.tsx | 642 +++++++++--------- 1 file changed, 321 insertions(+), 321 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 1efb8d63..6ae26df6 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 @@ -23,12 +23,12 @@ import { TransferEditorType, TransferFilesInfo } from '../../../extensionTransfe // Sidebar navigation helpers // ───────────────────────────────────────────── type SectionKey = - | 'models' - | 'localProviders' - | 'providers' - | 'featureOptions' - | 'general' - | 'all'; + | 'models' + | 'localProviders' + | 'providers' + | 'featureOptions' + | 'general' + | 'all'; const ButtonLeftTextRightOption = ({ text, leftButton }: { text: string, leftButton?: React.ReactNode }) => { @@ -910,19 +910,19 @@ export const OneClickSwitchButton = ({ fromEditor = 'VS Code', className = '' }: export const Settings = () => { const isDark = useIsDark() - // ─── sidebar nav ────────────────────────── - const [selectedSection, setSelectedSection] = - useState('models'); + // ─── sidebar nav ────────────────────────── + const [selectedSection, setSelectedSection] = + useState('models'); - const navItems: { key: SectionKey; label: string }[] = [ - { key: 'models', label: 'Models' }, - { key: 'localProviders', label: 'Local Providers' }, - { key: 'providers', label: 'Providers' }, - { key: 'featureOptions', label: 'Feature Options' }, - { key: 'general', label: 'General' }, - { key: 'all', label: 'All Settings' }, - ]; - const show = (key: SectionKey) => selectedSection === 'all' || selectedSection === key; + const navItems: { key: SectionKey; label: string }[] = [ + { key: 'models', label: 'Models' }, + { key: 'localProviders', label: 'Local Providers' }, + { key: 'providers', label: 'Providers' }, + { key: 'featureOptions', label: 'Feature Options' }, + { key: 'general', label: 'General' }, + { key: 'all', label: 'All Settings' }, + ]; + const show = (key: SectionKey) => selectedSection === 'all' || selectedSection === key; const accessor = useAccessor() const commandService = accessor.get('ICommandService') const environmentService = accessor.get('IEnvironmentService') @@ -997,334 +997,334 @@ export const Settings = () => { return ( -
-
- {/* ────────────── SIDEBAR ────────────── */} +
+
+ {/* ────────────── SIDEBAR ────────────── */} - - - {/* ───────────── MAIN PANE ───────────── */} -
- - - -
- -

{`Void's Settings`}

- -
- - {/* Models section (formerly FeaturesTab) */} - - - - -
- - {/* Models section (formerly FeaturesTab) */} - -{show('models') && ( -<> -

Models

- -
- - - - )} - -{show('localProviders') && ( - - <> - -

Local Providers

-

{`Void can access any model that you host locally. We automatically detect your local models by default.`}

- -
- -
- - - - -
-)} -{show('providers') && ( - - <> -

Providers

-

{`Void can access models from Anthropic, OpenAI, OpenRouter, and more.`}

- - - -
-)} - - -{show('featureOptions') && ( - - <> -

Feature Options

- -
- - {/* FIM */} -
-

{displayInfoOfFeatureName('Autocomplete')}

-
- - Experimental.{' '} - - - Only works with FIM models.* - -
- -
- {/* Enable Switch */} - -
- voidSettingsService.setGlobalSetting('enableAutocomplete', newVal)} - /> - {settingsState.globalSettings.enableAutocomplete ? 'Enabled' : 'Disabled'} -
-
- - {/* Model Dropdown */} - -
- -
-
- -
- -
-
- - {/* Apply */} - - -
-

{displayInfoOfFeatureName('Apply')}

-
Settings that control the behavior of the Apply button.
- -
- {/* Sync to Chat Switch */} -
- voidSettingsService.setGlobalSetting('syncApplyToChat', newVal)} - /> - {settingsState.globalSettings.syncApplyToChat ? 'Same as Chat model' : 'Different model'} -
- - {/* Model Dropdown */} -
- -
-
- - -
- {/* Fast Apply Method Dropdown */} -
- -
-
- -
-
- - - - - {/* Tools Section */} -
-

Tools

-
{`Tools are functions that LLMs can call. Some tools require user approval.`}
- -
- {/* Auto Accept Switch */} - - {[...toolApprovalTypes].map((approvalType) => { - return
- -
- })} - -
- - {/* Tool Lint Errors Switch */} - - -
- voidSettingsService.setGlobalSetting('includeToolLintErrors', newVal)} - /> - {settingsState.globalSettings.includeToolLintErrors ? 'Fix lint errors' : `Fix lint errors`} -
-
-
+ > + {label} + + ))}
+ + + {/* ───────────── MAIN PANE ───────────── */} +
-
-

Editor

-
{`Settings that control the visibility of Void suggestions in the code editor.`}
+
-
- {/* Auto Accept Switch */} +

{`Void's Settings`}

+ +
+ + {/* Models section (formerly FeaturesTab) */} + + + + +
+ + {/* Models section (formerly FeaturesTab) */} + + {show('models') && ( + <> +

Models

+ +
+ + + + )} + + {show('localProviders') && ( -
- voidSettingsService.setGlobalSetting('showInlineSuggestions', newVal)} - /> - {settingsState.globalSettings.showInlineSuggestions ? 'Show suggestions on select' : 'Show suggestions on select'} -
+ <> + +

Local Providers

+

{`Void can access any model that you host locally. We automatically detect your local models by default.`}

+ +
+ +
+ + + +
-
-
-
- - -)} + )} + {show('providers') && ( + + <> +

Providers

+

{`Void can access models from Anthropic, OpenAI, OpenRouter, and more.`}

+ + + +
+ )} -{show('general') && ( - <> + {show('featureOptions') && ( + + <> +

Feature Options

- {/* General section (formerly GeneralTab) */} -
- -

One-Click Switch

-

{`Transfer your editor settings into Void.`}

+
+ + {/* FIM */} +
+

{displayInfoOfFeatureName('Autocomplete')}

+
+ + Experimental.{' '} + + + Only works with FIM models.* + +
-
- - - -
- -
+
+ {/* Enable Switch */} + +
+ voidSettingsService.setGlobalSetting('enableAutocomplete', newVal)} + /> + {settingsState.globalSettings.enableAutocomplete ? 'Enabled' : 'Disabled'} +
+
- {/* Import/Export section, as its own block right after One-Click Switch */} -
-

Import/Export

-

{`Transfer Void's settings and chats in and out of Void.`}

-
- {/* Settings Subcategory */} -
- - { fileInputSettingsRef.current?.click() }}> - Import Settings - - onDownload('Settings')}> - Export Settings - - { voidSettingsService.resetState(); }}> - Reset Settings - -
- {/* Chats Subcategory */} -
- - { fileInputChatsRef.current?.click() }}> - Import Chats - - onDownload('Chats')}> - Export Chats - - { chatThreadsService.resetState(); }}> - Reset Chats - -
-
-
+ {/* Model Dropdown */} + +
+ +
+
+ +
+ +
+
+ + {/* Apply */} + + +
+

{displayInfoOfFeatureName('Apply')}

+
Settings that control the behavior of the Apply button.
+ +
+ {/* Sync to Chat Switch */} +
+ voidSettingsService.setGlobalSetting('syncApplyToChat', newVal)} + /> + {settingsState.globalSettings.syncApplyToChat ? 'Same as Chat model' : 'Different model'} +
+ + {/* Model Dropdown */} +
+ +
+
+ + +
+ {/* Fast Apply Method Dropdown */} +
+ +
+
+ +
+
-
-

Built-in Settings

-

{`IDE settings, keyboard settings, and theme customization.`}

+ {/* Tools Section */} +
+

Tools

+
{`Tools are functions that LLMs can call. Some tools require user approval.`}
- -
- { commandService.executeCommand('workbench.action.openSettings') }}> - General Settings - - { commandService.executeCommand('workbench.action.openGlobalKeybindings') }}> - Keyboard Settings - - { commandService.executeCommand('workbench.action.selectTheme') }}> - Theme Settings - - { nativeHostService.showItemInFolder(environmentService.logsHome.fsPath) }}> - Open Logs - -
-
-
+
+ {/* Auto Accept Switch */} + + {[...toolApprovalTypes].map((approvalType) => { + return
+ +
+ })} + +
+ + {/* Tool Lint Errors Switch */} + + +
+ voidSettingsService.setGlobalSetting('includeToolLintErrors', newVal)} + /> + {settingsState.globalSettings.includeToolLintErrors ? 'Fix lint errors' : `Fix lint errors`} +
+
+
+
-
-

AI Instructions

-

- +

Editor

+
{`Settings that control the visibility of Void suggestions in the code editor.`}
+ +
+ {/* Auto Accept Switch */} + +
+ voidSettingsService.setGlobalSetting('showInlineSuggestions', newVal)} + /> + {settingsState.globalSettings.showInlineSuggestions ? 'Show suggestions on select' : 'Show suggestions on select'} +
+
+
+

+
+ +
+ )} + + + {show('general') && ( + <> + + {/* General section (formerly GeneralTab) */} +
+ +

One-Click Switch

+

{`Transfer your editor settings into Void.`}

+ +
+ + + +
+
+
+ + {/* Import/Export section, as its own block right after One-Click Switch */} +
+

Import/Export

+

{`Transfer Void's settings and chats in and out of Void.`}

+
+ {/* Settings Subcategory */} +
+ + { fileInputSettingsRef.current?.click() }}> + Import Settings + + onDownload('Settings')}> + Export Settings + + { voidSettingsService.resetState(); }}> + Reset Settings + +
+ {/* Chats Subcategory */} +
+ + { fileInputChatsRef.current?.click() }}> + Import Chats + + onDownload('Chats')}> + Export Chats + + { chatThreadsService.resetState(); }}> + Reset Chats + +
+
+
+ + + +
+ +

Built-in Settings

+

{`IDE settings, keyboard settings, and theme customization.`}

+ + +
+ { commandService.executeCommand('workbench.action.openSettings') }}> + General Settings + + { commandService.executeCommand('workbench.action.openGlobalKeybindings') }}> + Keyboard Settings + + { commandService.executeCommand('workbench.action.selectTheme') }}> + Theme Settings + + { nativeHostService.showItemInFolder(environmentService.logsHome.fsPath) }}> + Open Logs + +
+
+
+ + +
+

AI Instructions

+

+ -

- - - -
- -)} + + + + +
+ + )} -
-
-
-
-); +
+
+
+
+ ); }