Skip to content

Commit ebf213a

Browse files
committed
Move back button to QuickInputButtons (microsoft#53327)
1 parent d7c1985 commit ebf213a

2 files changed

Lines changed: 24 additions & 13 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,6 @@ declare module 'vscode' {
701701

702702
export namespace window {
703703

704-
/**
705-
* A back button for [QuickPick](#QuickPick) and [InputBox](#InputBox).
706-
*
707-
* When a navigation 'back' button is needed this one should be used for consistency.
708-
* It comes with a predefined icon, tooltip and location.
709-
*/
710-
export const quickInputBackButton: QuickInputButton;
711-
712704
/**
713705
* Creates a [QuickPick](#QuickPick) to let the user pick an item from a list
714706
* of items of type T.
@@ -977,6 +969,20 @@ declare module 'vscode' {
977969
readonly tooltip?: string | undefined;
978970
}
979971

972+
/**
973+
* Predefined buttons for [QuickPick](#QuickPick) and [InputBox](#InputBox).
974+
*/
975+
export namespace QuickInputButtons {
976+
977+
/**
978+
* A back button for [QuickPick](#QuickPick) and [InputBox](#InputBox).
979+
*
980+
* When a navigation 'back' button is needed this one should be used for consistency.
981+
* It comes with a predefined icon, tooltip and location.
982+
*/
983+
export const Back: QuickInputButton;
984+
}
985+
980986
//#endregion
981987

982988
//#region joh: https://github.com/Microsoft/vscode/issues/10659

src/vs/workbench/api/node/extHost.api.impl.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,6 @@ export function createApiFactory(
455455
registerUriHandler(handler: vscode.UriHandler) {
456456
return extHostUrls.registerUriHandler(extension.id, handler);
457457
},
458-
get quickInputBackButton() {
459-
return proposedApiFunction(extension, (): vscode.QuickInputButton => {
460-
return extHostQuickOpen.backButton;
461-
})();
462-
},
463458
createQuickPick: proposedApiFunction(extension, <T extends vscode.QuickPickItem>(): vscode.QuickPick<T> => {
464459
return extHostQuickOpen.createQuickPick(extension.id);
465460
}),
@@ -468,6 +463,15 @@ export function createApiFactory(
468463
}),
469464
};
470465

466+
// namespace: QuickInputButtons
467+
const QuickInputButtons: typeof vscode.QuickInputButtons = {
468+
get Back() {
469+
return proposedApiFunction(extension, (): vscode.QuickInputButton => {
470+
return extHostQuickOpen.backButton;
471+
})();
472+
},
473+
};
474+
471475
// namespace: workspace
472476
const workspace: typeof vscode.workspace = {
473477
get rootPath() {
@@ -722,6 +726,7 @@ export function createApiFactory(
722726
OverviewRulerLane: OverviewRulerLane,
723727
ParameterInformation: extHostTypes.ParameterInformation,
724728
Position: extHostTypes.Position,
729+
QuickInputButtons,
725730
Range: extHostTypes.Range,
726731
Selection: extHostTypes.Selection,
727732
SignatureHelp: extHostTypes.SignatureHelp,

0 commit comments

Comments
 (0)