basic changes with debugging logs

This commit is contained in:
Evan 2025-01-18 15:45:17 +08:00
parent 52bb98fd90
commit 8cfc0fa4f4
4 changed files with 37 additions and 8 deletions

View file

@ -550,10 +550,11 @@ export class ClineProvider implements vscode.WebviewViewProvider {
this.cancelTask()
break
case "openMcpSettings": {
const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
if (mcpSettingsFilePath) {
openFile(mcpSettingsFilePath)
}
await vscode.commands.executeCommand("workbench.action.openSettings")
// const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
// if (mcpSettingsFilePath) {
// openFile(mcpSettingsFilePath)
// }
break
}
case "restartMcpServer": {
@ -564,6 +565,15 @@ export class ClineProvider implements vscode.WebviewViewProvider {
}
break
}
case "openExtensionSettings": {
const mcpSettingsFilePath = await this.mcpHub?.getMcpSettingsFilePath()
if (mcpSettingsFilePath) {
openFile(mcpSettingsFilePath)
}
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

@ -31,6 +31,7 @@ export interface WebviewMessage {
| "checkpointDiff"
| "checkpointRestore"
| "taskCompletionViewChanges"
| "openExtensionSettings"
// | "relaunchChromeDebugMode"
text?: string
askResponse?: ClineAskResponse

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 Settings
Edit MCP Settingssss
</VSCodeButton>
</div>

View file

@ -5,7 +5,8 @@ import { validateApiConfiguration, validateModelId } from "../../utils/validate"
import { vscode } from "../../utils/vscode"
import ApiOptions from "./ApiOptions"
const IS_DEV = false // FIXME: use flags when packaging
// In development, process.env.NODE_ENV is 'development'
const IS_DEV = process.env.NODE_ENV === 'development'
type SettingsViewProps = {
onDone: () => void
@ -128,14 +129,31 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
</>
)}
<div
style={{
marginTop: "auto",
paddingRight: 8,
display: "flex",
justifyContent: "center",
}}>
<VSCodeButton
appearance="secondary"
onClick={() => vscode.postMessage({ type: "openExtensionSettings" })}
style={{
margin: "0 0 16px 0",
minWidth: "fit-content",
whiteSpace: "nowrap",
}}>
Advanced Settings
</VSCodeButton>
</div>
<div
style={{
textAlign: "center",
color: "var(--vscode-descriptionForeground)",
fontSize: "12px",
lineHeight: "1.2",
marginTop: "auto",
padding: "10px 8px 15px 0px",
padding: "0 8px 15px 0",
}}>
<p
style={{