Compare commits

...

2 Commits

Author SHA1 Message Date
abeatrix 9dbf850627 changeset 2025-07-15 17:59:01 -07:00
abeatrix e042ba5a03 Fix: pass items to showMessage in VS Code host bridge
This change allows the `showMessage` host bridge method to pass an array of `items` to the VS Code `window.show*Message` methods. This enables the display of quick pick options in the message box.
2025-07-15 17:48:05 -07:00
2 changed files with 12 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Fix missing options from window messages.
@@ -1,22 +1,24 @@
import { window } from "vscode"
import { SelectedResponse, ShowMessageRequest, ShowMessageType } from "@/shared/proto/index.host"
const DEFAULT_OPTIONS = { modal: false, items: [] } as const
export async function showMessage(request: ShowMessageRequest): Promise<SelectedResponse | undefined> {
const { message, type, options } = request
const { modal, detail, items } = options || {}
const option = items ? { modal, items } : { modal, detail }
const { modal, detail, items } = { ...DEFAULT_OPTIONS, ...options }
const option = { modal, detail }
let selectedOption: string | undefined = undefined
switch (type) {
case ShowMessageType.ERROR:
selectedOption = await window.showErrorMessage(message, option)
selectedOption = await window.showErrorMessage(message, option, ...items)
break
case ShowMessageType.WARNING:
selectedOption = await window.showWarningMessage(message, option)
selectedOption = await window.showWarningMessage(message, option, ...items)
break
default:
selectedOption = await window.showInformationMessage(message, option)
selectedOption = await window.showInformationMessage(message, option, ...items)
break
}