Add the setting to ExtensionMessage.ts:
preferredLanguage: stringAdd test coverage:
Add the message type to WebviewMessage.ts:
| "multisearchDiffEnabled"Add the setting to ExtensionStateContext.tsx:
Example:
interface ExtensionStateContextType {
multisearchDiffEnabled: boolean
setMultisearchDiffEnabled: (value: boolean) => void
}
Add the setting to ClineProvider.ts:
Example:
case "multisearchDiffEnabled":
await this.updateGlobalState("multisearchDiffEnabled", message.bool)
await this.postStateToWebview()
break
Add the checkbox UI to SettingsView.tsx:
Example:
<VSCodeCheckbox
checked={multisearchDiffEnabled}
onChange={(e: any) => setMultisearchDiffEnabled(e.target.checked)}
>
<span style={{ fontWeight: "500" }}>Enable multi-search diff matching</span>
</VSCodeCheckbox>
Add the setting to handleSubmit in SettingsView.tsx:
Example:
vscode.postMessage({ type: "multisearchDiffEnabled", bool: multisearchDiffEnabled })
Add the message type to WebviewMessage.ts:
| "preferredLanguage"Add the setting to ExtensionStateContext.tsx:
Example:
interface ExtensionStateContextType {
preferredLanguage: string
setPreferredLanguage: (value: string) => void
}
Add the setting to ClineProvider.ts:
Example:
case "preferredLanguage":
await this.updateGlobalState("preferredLanguage", message.text)
await this.postStateToWebview()
break
Add the select UI to SettingsView.tsx:
Example:
<select
value={preferredLanguage}
onChange={(e) => setPreferredLanguage(e.target.value)}
style={{
width: "100%",
padding: "4px 8px",
backgroundColor: "var(--vscode-input-background)",
color: "var(--vscode-input-foreground)",
border: "1px solid var(--vscode-input-border)",
borderRadius: "2px"
}}>
<option value="English">English</option>
<option value="Spanish">Spanish</option>
...
</select>
Add the setting to handleSubmit in SettingsView.tsx:
Example:
vscode.postMessage({ type: "preferredLanguage", text: preferredLanguage })
These steps ensure that: