Skip to content

Commit 8cfc0fa

Browse files
basic changes with debugging logs
1 parent 52bb98f commit 8cfc0fa

File tree

4 files changed

+37
-8
lines changed

4 files changed

+37
-8
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,11 @@ export class ClineProvider implements vscode.WebviewViewProvider {
550550
this.cancelTask()
551551
break
552552
case "openMcpSettings": {
553-
const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
554-
if (mcpSettingsFilePath) {
555-
openFile(mcpSettingsFilePath)
556-
}
553+
await vscode.commands.executeCommand("workbench.action.openSettings")
554+
// const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
555+
// if (mcpSettingsFilePath) {
556+
// openFile(mcpSettingsFilePath)
557+
// }
557558
break
558559
}
559560
case "restartMcpServer": {
@@ -564,6 +565,15 @@ export class ClineProvider implements vscode.WebviewViewProvider {
564565
}
565566
break
566567
}
568+
case "openExtensionSettings": {
569+
const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
570+
if (mcpSettingsFilePath) {
571+
openFile(mcpSettingsFilePath)
572+
}
573+
break
574+
// await vscode.commands.executeCommand("workbench.action.openSettings")
575+
// break
576+
}
567577
// Add more switch case statements here as more webview message commands
568578
// are created within the webview context (i.e. inside media/main.js)
569579
}

src/shared/WebviewMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface WebviewMessage {
3131
| "checkpointDiff"
3232
| "checkpointRestore"
3333
| "taskCompletionViewChanges"
34+
| "openExtensionSettings"
3435
// | "relaunchChromeDebugMode"
3536
text?: string
3637
askResponse?: ClineAskResponse

webview-ui/src/components/mcp/McpView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const McpView = ({ onDone }: McpViewProps) => {
141141
vscode.postMessage({ type: "openMcpSettings" })
142142
}}>
143143
<span className="codicon codicon-edit" style={{ marginRight: "6px" }}></span>
144-
Edit MCP Settings
144+
Edit MCP Settingssss
145145
</VSCodeButton>
146146
</div>
147147

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { validateApiConfiguration, validateModelId } from "../../utils/validate"
55
import { vscode } from "../../utils/vscode"
66
import ApiOptions from "./ApiOptions"
77

8-
const IS_DEV = false // FIXME: use flags when packaging
8+
// In development, process.env.NODE_ENV is 'development'
9+
const IS_DEV = process.env.NODE_ENV === 'development'
910

1011
type SettingsViewProps = {
1112
onDone: () => void
@@ -128,14 +129,31 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
128129
</>
129130
)}
130131

132+
<div
133+
style={{
134+
marginTop: "auto",
135+
paddingRight: 8,
136+
display: "flex",
137+
justifyContent: "center",
138+
}}>
139+
<VSCodeButton
140+
appearance="secondary"
141+
onClick={() => vscode.postMessage({ type: "openExtensionSettings" })}
142+
style={{
143+
margin: "0 0 16px 0",
144+
minWidth: "fit-content",
145+
whiteSpace: "nowrap",
146+
}}>
147+
Advanced Settings
148+
</VSCodeButton>
149+
</div>
131150
<div
132151
style={{
133152
textAlign: "center",
134153
color: "var(--vscode-descriptionForeground)",
135154
fontSize: "12px",
136155
lineHeight: "1.2",
137-
marginTop: "auto",
138-
padding: "10px 8px 15px 0px",
156+
padding: "0 8px 15px 0",
139157
}}>
140158
<p
141159
style={{

0 commit comments

Comments
 (0)