diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 095df41de3edf..c726e767cde64 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1674,4 +1674,33 @@ declare module 'vscode' { } //#endregion + + //#region Dialog title: https://github.com/microsoft/vscode/issues/82871 + + /** + * Options to configure the behaviour of a file open dialog. + * + * * Note 1: A dialog can select files, folders, or both. This is not true for Windows + * which enforces to open either files or folder, but *not both*. + * * Note 2: Explicitly setting `canSelectFiles` and `canSelectFolders` to `false` is futile + * and the editor then silently adjusts the options to select files. + */ + export interface OpenDialogOptions { + /** + * Dialog title + */ + title?: string; + } + + /** + * Options to configure the behaviour of a file save dialog. + */ + export interface SaveDialogOptions { + /** + * Dialog title + */ + title?: string; + } + + //#endregion } diff --git a/src/vs/workbench/api/browser/mainThreadDialogs.ts b/src/vs/workbench/api/browser/mainThreadDialogs.ts index 94ab09b7eba1b..79c26c34570be 100644 --- a/src/vs/workbench/api/browser/mainThreadDialogs.ts +++ b/src/vs/workbench/api/browser/mainThreadDialogs.ts @@ -37,7 +37,8 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape { canSelectFiles: options.canSelectFiles || (!options.canSelectFiles && !options.canSelectFolders), canSelectFolders: options.canSelectFolders, canSelectMany: options.canSelectMany, - defaultUri: options.defaultUri ? URI.revive(options.defaultUri) : undefined + defaultUri: options.defaultUri ? URI.revive(options.defaultUri) : undefined, + title: options.title || undefined }; if (options.filters) { result.filters = []; @@ -49,7 +50,8 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape { private static _convertSaveOptions(options: MainThreadDialogSaveOptions): ISaveDialogOptions { const result: ISaveDialogOptions = { defaultUri: options.defaultUri ? URI.revive(options.defaultUri) : undefined, - saveLabel: options.saveLabel || undefined + saveLabel: options.saveLabel || undefined, + title: options.title || undefined }; if (options.filters) { result.filters = []; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 56f2530c0edfa..ddaa2ecd71a0d 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -174,12 +174,14 @@ export interface MainThreadDialogOpenOptions { canSelectFolders?: boolean; canSelectMany?: boolean; filters?: { [name: string]: string[]; }; + title?: string; } export interface MainThreadDialogSaveOptions { defaultUri?: UriComponents; saveLabel?: string; filters?: { [name: string]: string[]; }; + title?: string; } export interface MainThreadDiaglogsShape extends IDisposable {