mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Finalize quickPickItemResource API proposal (#283877)
This commit is contained in:
@@ -34,7 +34,6 @@
|
|||||||
"portsAttributes",
|
"portsAttributes",
|
||||||
"quickInputButtonLocation",
|
"quickInputButtonLocation",
|
||||||
"quickPickSortByLabel",
|
"quickPickSortByLabel",
|
||||||
"quickPickItemResource",
|
|
||||||
"resolvers",
|
"resolvers",
|
||||||
"scmActionButton",
|
"scmActionButton",
|
||||||
"scmSelectedProvider",
|
"scmSelectedProvider",
|
||||||
|
|||||||
@@ -334,9 +334,6 @@ const _allApiProposals = {
|
|||||||
quickInputButtonLocation: {
|
quickInputButtonLocation: {
|
||||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts',
|
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts',
|
||||||
},
|
},
|
||||||
quickPickItemResource: {
|
|
||||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemResource.d.ts',
|
|
||||||
},
|
|
||||||
quickPickItemTooltip: {
|
quickPickItemTooltip: {
|
||||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts',
|
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -102,10 +102,6 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
|||||||
checkProposedApiEnabled(extension, 'quickPickItemTooltip');
|
checkProposedApiEnabled(extension, 'quickPickItemTooltip');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.resourceUri) {
|
|
||||||
checkProposedApiEnabled(extension, 'quickPickItemResource');
|
|
||||||
}
|
|
||||||
|
|
||||||
pickItems.push({
|
pickItems.push({
|
||||||
label: item.label,
|
label: item.label,
|
||||||
iconPathDto: IconPath.from(item.iconPath),
|
iconPathDto: IconPath.from(item.iconPath),
|
||||||
@@ -576,10 +572,6 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
|||||||
checkProposedApiEnabled(this._extension, 'quickPickItemTooltip');
|
checkProposedApiEnabled(this._extension, 'quickPickItemTooltip');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.resourceUri) {
|
|
||||||
checkProposedApiEnabled(this._extension, 'quickPickItemResource');
|
|
||||||
}
|
|
||||||
|
|
||||||
pickItems.push({
|
pickItems.push({
|
||||||
handle,
|
handle,
|
||||||
label: item.label,
|
label: item.label,
|
||||||
|
|||||||
11
src/vscode-dts/vscode.d.ts
vendored
11
src/vscode-dts/vscode.d.ts
vendored
@@ -1938,6 +1938,17 @@ declare module 'vscode' {
|
|||||||
*/
|
*/
|
||||||
detail?: string;
|
detail?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link Uri} representing the resource associated with this item.
|
||||||
|
*
|
||||||
|
* When set, this property is used to automatically derive several item properties if they are not explicitly provided:
|
||||||
|
* - **Label**: Derived from the resource's file name when {@link QuickPickItem.label label} is not provided or is empty.
|
||||||
|
* - **Description**: Derived from the resource's path when {@link QuickPickItem.description description} is not provided or is empty.
|
||||||
|
* - **Icon**: Derived from the current file icon theme when {@link QuickPickItem.iconPath iconPath} is set to
|
||||||
|
* {@link ThemeIcon.File} or {@link ThemeIcon.Folder}.
|
||||||
|
*/
|
||||||
|
resourceUri?: Uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional flag indicating if this item is initially selected.
|
* Optional flag indicating if this item is initially selected.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* 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/59826
|
|
||||||
|
|
||||||
export interface QuickPickItem {
|
|
||||||
/**
|
|
||||||
* A {@link Uri} representing the resource associated with this item.
|
|
||||||
*
|
|
||||||
* When set, this property is used to automatically derive several item properties if they are not explicitly provided:
|
|
||||||
* - **Label**: Derived from the resource's file name when {@link QuickPickItem.label label} is not provided or is empty.
|
|
||||||
* - **Description**: Derived from the resource's path when {@link QuickPickItem.description description} is not provided or is empty.
|
|
||||||
* - **Icon**: Derived from the current file icon theme when {@link QuickPickItem.iconPath iconPath} is set to
|
|
||||||
* {@link ThemeIcon.File} or {@link ThemeIcon.Folder}.
|
|
||||||
*/
|
|
||||||
resourceUri?: Uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user