diff --git a/src/vs/base/parts/quickinput/browser/quickInput.ts b/src/vs/base/parts/quickinput/browser/quickInput.ts index bea0f810f49..63c4a28ee7e 100644 --- a/src/vs/base/parts/quickinput/browser/quickInput.ts +++ b/src/vs/base/parts/quickinput/browser/quickInput.ts @@ -1406,6 +1406,7 @@ export class QuickInputController extends Disposable { resolve(undefined); }), ]; + input.title = options.title; input.canSelectMany = !!options.canPickMany; input.placeholder = options.placeHolder; input.ignoreFocusOut = !!options.ignoreFocusLost; @@ -1499,6 +1500,8 @@ export class QuickInputController extends Disposable { resolve(undefined); }), ]; + + input.title = options.title; input.value = options.value || ''; input.valueSelection = options.valueSelection; input.prompt = options.prompt; diff --git a/src/vs/base/parts/quickinput/common/quickInput.ts b/src/vs/base/parts/quickinput/common/quickInput.ts index 33c29d9d3ed..477f416943c 100644 --- a/src/vs/base/parts/quickinput/common/quickInput.ts +++ b/src/vs/base/parts/quickinput/common/quickInput.ts @@ -59,6 +59,11 @@ export interface IQuickNavigateConfiguration { export interface IPickOptions { + /** + * an optional string to show as the title of the quick input + */ + title?: string; + /** * an optional string to show as placeholder in the input box to guide the user what she picks on */ @@ -116,6 +121,11 @@ export interface IPickOptions { export interface IInputOptions { + /** + * an optional string to show as the title of the quick input + */ + title?: string; + /** * the value to prefill in the input box */ diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 4a90f0d8647..62204fdd7db 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -924,6 +924,24 @@ declare module 'vscode' { //#endregion + //#region allow title property to QuickPickOptions/InputBoxOptions: https://github.com/microsoft/vscode/issues/77423 + + interface QuickPickOptions { + /** + * An optional string that represents the tile of the quick pick. + */ + title?: string; + } + + interface InputBoxOptions { + /** + * An optional string that represents the tile of the input box. + */ + title?: string; + } + + //#endregion + //#region Provide a way for custom editors to process untitled files without relying on textDocument https://github.com/microsoft/vscode/issues/115631 /** * Additional information about the opening custom document. diff --git a/src/vs/workbench/api/browser/mainThreadQuickOpen.ts b/src/vs/workbench/api/browser/mainThreadQuickOpen.ts index e1a8fdbd11a..45f9f551130 100644 --- a/src/vs/workbench/api/browser/mainThreadQuickOpen.ts +++ b/src/vs/workbench/api/browser/mainThreadQuickOpen.ts @@ -89,6 +89,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape { const inputOptions: IInputOptions = Object.create(null); if (options) { + inputOptions.title = options.title; inputOptions.password = options.password; inputOptions.placeHolder = options.placeHolder; inputOptions.valueSelection = options.valueSelection; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 9e2f8e7b39e..253949bd83c 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -505,6 +505,8 @@ export interface BaseTransferQuickInput { id: number; + title?: string; + type?: 'quickPick' | 'inputBox'; enabled?: boolean; @@ -559,6 +561,7 @@ export interface TransferInputBox extends BaseTransferQuickInput { } export interface IInputBoxOptions { + title?: string; value?: string; valueSelection?: [number, number]; prompt?: string; diff --git a/src/vs/workbench/api/common/extHostQuickOpen.ts b/src/vs/workbench/api/common/extHostQuickOpen.ts index 0d32f885bd7..41a6eaae090 100644 --- a/src/vs/workbench/api/common/extHostQuickOpen.ts +++ b/src/vs/workbench/api/common/extHostQuickOpen.ts @@ -68,11 +68,12 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx const instance = ++this._instances; const quickPickWidget = proxy.$show(instance, { - placeHolder: options && options.placeHolder, - matchOnDescription: options && options.matchOnDescription, - matchOnDetail: options && options.matchOnDetail, - ignoreFocusLost: options && options.ignoreFocusOut, - canPickMany: options && options.canPickMany + title: options?.title, + placeHolder: options?.placeHolder, + matchOnDescription: options?.matchOnDescription, + matchOnDetail: options?.matchOnDetail, + ignoreFocusLost: options?.ignoreFocusOut, + canPickMany: options?.canPickMany, }, token); const widgetClosedMarker = {};