Merge from vscode 61d5f2b82f17bf9f99f56405204caab88a7e8747

This commit is contained in:
ADS Merger
2020-03-19 06:57:07 +00:00
parent 03ce5d1ba7
commit 84f67f61c4
137 changed files with 13234 additions and 796 deletions

View File

@@ -35,11 +35,6 @@ export interface IQuickPickItem {
strikethrough?: boolean;
highlights?: IQuickPickItemHighlights;
buttons?: IQuickInputButton[];
/**
* Wether to always show the buttons. By default buttons
* are only visible when hovering over them with the mouse
*/
buttonsAlwaysVisible?: boolean;
picked?: boolean;
alwaysShow?: boolean;
}
@@ -290,6 +285,11 @@ export interface IQuickInputButton {
/** iconPath or iconClass required */
iconClass?: string;
tooltip?: string;
/**
* Wether to always show the button. By default buttons
* are only visible when hovering over them with the mouse
*/
alwaysVisible?: boolean;
}
export interface IQuickPickItemButtonEvent<T extends IQuickPickItem> {
@@ -308,22 +308,35 @@ export type QuickPickInput<T = IQuickPickItem> = T | IQuickPickSeparator;
export type IQuickPickItemWithResource = IQuickPickItem & { resource: URI | undefined };
export const quickPickItemScorerAccessor = new class implements IItemAccessor<IQuickPickItemWithResource> {
export class QuickPickItemScorerAccessor implements IItemAccessor<IQuickPickItemWithResource> {
constructor(private options?: { skipDescription?: boolean, skipPath?: boolean }) { }
getItemLabel(entry: IQuickPickItemWithResource): string {
return entry.label;
}
getItemDescription(entry: IQuickPickItemWithResource): string | undefined {
if (this.options?.skipDescription) {
return undefined;
}
return entry.description;
}
getItemPath(entry: IQuickPickItemWithResource): string | undefined {
if (this.options?.skipPath) {
return undefined;
}
if (entry.resource?.scheme === Schemas.file) {
return entry.resource.fsPath;
}
return entry.resource?.path;
}
};
}
export const quickPickItemScorerAccessor = new QuickPickItemScorerAccessor();
//#endregion