Finalize quickPickItemResource API proposal (#283877)

This commit is contained in:
Dmitriy Vasyura
2025-12-16 11:11:02 -08:00
committed by GitHub
parent cea4fe5e1c
commit 56555a8bf1
5 changed files with 11 additions and 34 deletions

View File

@@ -34,7 +34,6 @@
"portsAttributes", "portsAttributes",
"quickInputButtonLocation", "quickInputButtonLocation",
"quickPickSortByLabel", "quickPickSortByLabel",
"quickPickItemResource",
"resolvers", "resolvers",
"scmActionButton", "scmActionButton",
"scmSelectedProvider", "scmSelectedProvider",

View File

@@ -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',
}, },

View File

@@ -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,

View File

@@ -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.
* *

View File

@@ -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;
}
}