mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-04 01:44:44 -06:00
Revert "Finalize quickPickButtonLocation API proposal" (#285984)
This commit is contained in:
parent
9564c70e1e
commit
cbc91ee43b
@ -25,6 +25,7 @@
|
||||
"contribViewsWelcome",
|
||||
"editSessionIdentityProvider",
|
||||
"quickDiffProvider",
|
||||
"quickInputButtonLocation",
|
||||
"quickPickSortByLabel",
|
||||
"scmActionButton",
|
||||
"scmArtifactProvider",
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
"../../src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.scmActionButton.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.scmArtifactProvider.d.ts",
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
"notebookMessaging",
|
||||
"notebookMime",
|
||||
"portsAttributes",
|
||||
"quickInputButtonLocation",
|
||||
"quickPickSortByLabel",
|
||||
"resolvers",
|
||||
"scmActionButton",
|
||||
|
||||
@ -331,6 +331,9 @@ const _allApiProposals = {
|
||||
quickDiffProvider: {
|
||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts',
|
||||
},
|
||||
quickInputButtonLocation: {
|
||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts',
|
||||
},
|
||||
quickPickItemTooltip: {
|
||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts',
|
||||
},
|
||||
|
||||
@ -391,6 +391,12 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
||||
}
|
||||
|
||||
set buttons(buttons: QuickInputButton[]) {
|
||||
if (buttons.some(button =>
|
||||
typeof button.location === 'number' ||
|
||||
typeof button.toggle === 'object' && typeof button.toggle.checked === 'boolean')) {
|
||||
checkProposedApiEnabled(this._extension, 'quickInputButtonLocation');
|
||||
}
|
||||
|
||||
this._buttons = buttons.slice();
|
||||
this._handlesToButtons.clear();
|
||||
buttons.forEach((button, i) => {
|
||||
|
||||
40
src/vscode-dts/vscode.d.ts
vendored
40
src/vscode-dts/vscode.d.ts
vendored
@ -13295,26 +13295,6 @@ declare module 'vscode' {
|
||||
validationMessage: string | InputBoxValidationMessage | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the location where a {@link QuickInputButton} should be rendered.
|
||||
*/
|
||||
export enum QuickInputButtonLocation {
|
||||
/**
|
||||
* The button is rendered in the title bar.
|
||||
*/
|
||||
Title = 1,
|
||||
|
||||
/**
|
||||
* The button is rendered inline to the right of the input box.
|
||||
*/
|
||||
Inline = 2,
|
||||
|
||||
/**
|
||||
* The button is rendered at the far end inside the input box.
|
||||
*/
|
||||
Input = 3
|
||||
}
|
||||
|
||||
/**
|
||||
* A button for an action in a {@link QuickPick} or {@link InputBox}.
|
||||
*/
|
||||
@ -13328,26 +13308,6 @@ declare module 'vscode' {
|
||||
* An optional tooltip displayed when hovering over the button.
|
||||
*/
|
||||
readonly tooltip?: string | undefined;
|
||||
|
||||
/**
|
||||
* The location where the button should be rendered.
|
||||
*
|
||||
* Defaults to {@link QuickInputButtonLocation.Title}.
|
||||
*
|
||||
* **Note:** This property is ignored if the button was added to a {@link QuickPickItem}.
|
||||
*/
|
||||
location?: QuickInputButtonLocation;
|
||||
|
||||
/**
|
||||
* When present, indicates that the button is a toggle button that can be checked or unchecked.
|
||||
*/
|
||||
readonly toggle?: {
|
||||
/**
|
||||
* Indicates whether the toggle button is currently checked.
|
||||
* This property will be updated when the button is toggled.
|
||||
*/
|
||||
checked: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
49
src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts
vendored
Normal file
49
src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/175662
|
||||
|
||||
/**
|
||||
* Specifies the location where a {@link QuickInputButton} should be rendered.
|
||||
*/
|
||||
export enum QuickInputButtonLocation {
|
||||
/**
|
||||
* The button is rendered in the title bar.
|
||||
*/
|
||||
Title = 1,
|
||||
|
||||
/**
|
||||
* The button is rendered inline to the right of the input box.
|
||||
*/
|
||||
Inline = 2,
|
||||
|
||||
/**
|
||||
* The button is rendered at the far end inside the input box.
|
||||
*/
|
||||
Input = 3
|
||||
}
|
||||
|
||||
export interface QuickInputButton {
|
||||
/**
|
||||
* The location where the button should be rendered.
|
||||
*
|
||||
* Defaults to {@link QuickInputButtonLocation.Title}.
|
||||
*
|
||||
* **Note:** This property is ignored if the button was added to a {@link QuickPickItem}.
|
||||
*/
|
||||
location?: QuickInputButtonLocation;
|
||||
|
||||
/**
|
||||
* When present, indicates that the button is a toggle button that can be checked or unchecked.
|
||||
*
|
||||
* **Note:** This property is currently only applicable to buttons with {@link QuickInputButtonLocation.Input} location.
|
||||
* It must be set for such buttons, and the state will be updated when the button is toggled.
|
||||
* It cannot be set for buttons with other location values.
|
||||
*/
|
||||
readonly toggle?: { checked: boolean };
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user