completed adding advanced settings button

This commit is contained in:
Evan 2025-01-18 16:32:45 +08:00
parent 8cfc0fa4f4
commit d0cdabe0ca
3 changed files with 7 additions and 14 deletions

View file

@ -550,11 +550,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
this.cancelTask()
break
case "openMcpSettings": {
await vscode.commands.executeCommand("workbench.action.openSettings")
// const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
// if (mcpSettingsFilePath) {
// openFile(mcpSettingsFilePath)
// }
const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
if (mcpSettingsFilePath) {
openFile(mcpSettingsFilePath)
}
break
}
case "restartMcpServer": {
@ -566,13 +565,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
break
}
case "openExtensionSettings": {
const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
if (mcpSettingsFilePath) {
openFile(mcpSettingsFilePath)
}
await vscode.commands.executeCommand("workbench.action.openSettings", "@ext:saoudrizwan.claude-dev")
break
// await vscode.commands.executeCommand("workbench.action.openSettings")
// break
}
// Add more switch case statements here as more webview message commands
// are created within the webview context (i.e. inside media/main.js)

View file

@ -141,7 +141,7 @@ const McpView = ({ onDone }: McpViewProps) => {
vscode.postMessage({ type: "openMcpSettings" })
}}>
<span className="codicon codicon-edit" style={{ marginRight: "6px" }}></span>
Edit MCP Settingssss
Edit MCP Settings
</VSCodeButton>
</div>

View file

@ -5,8 +5,7 @@ import { validateApiConfiguration, validateModelId } from "../../utils/validate"
import { vscode } from "../../utils/vscode"
import ApiOptions from "./ApiOptions"
// In development, process.env.NODE_ENV is 'development'
const IS_DEV = process.env.NODE_ENV === 'development'
const IS_DEV = false // FIXME: use flags when packaging
type SettingsViewProps = {
onDone: () => void