From d0cdabe0ca9495cc23ebe0bdfcafb378ee43238d Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 18 Jan 2025 16:32:45 +0800 Subject: [PATCH] completed adding advanced settings button --- src/core/webview/ClineProvider.ts | 16 +++++----------- webview-ui/src/components/mcp/McpView.tsx | 2 +- .../src/components/settings/SettingsView.tsx | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 06a17e99f3..fc9d1b9fcc 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -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) diff --git a/webview-ui/src/components/mcp/McpView.tsx b/webview-ui/src/components/mcp/McpView.tsx index 54c8098984..7fce15a96d 100644 --- a/webview-ui/src/components/mcp/McpView.tsx +++ b/webview-ui/src/components/mcp/McpView.tsx @@ -141,7 +141,7 @@ const McpView = ({ onDone }: McpViewProps) => { vscode.postMessage({ type: "openMcpSettings" }) }}> - Edit MCP Settingssss + Edit MCP Settings diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 4b2b79f338..c5526fb32c 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -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