Merge from vscode 79a1f5a5ca0c6c53db617aa1fa5a2396d2caebe2

This commit is contained in:
ADS Merger
2020-05-31 19:47:51 +00:00
parent 84492049e8
commit 28be33cfea
913 changed files with 28242 additions and 15549 deletions

View File

@@ -80,6 +80,9 @@ interface IUserFriendlyViewDescriptor {
name: string;
when?: string;
icon?: string;
contextualTitle?: string;
// From 'remoteViewDescriptor' type
group?: string;
remoteName?: string | string[];
@@ -100,6 +103,14 @@ const viewDescriptor: IJSONSchema = {
description: localize('vscode.extension.contributes.view.when', 'Condition which must be true to show this view'),
type: 'string'
},
icon: {
description: localize('vscode.extension.contributes.view.icon', "Path to the view icon. View icons are displayed when the name of the view cannot be shown. It is recommended that icons be in SVG, though any image file type is accepted."),
type: 'string'
},
contextualTitle: {
description: localize('vscode.extension.contributes.view.contextualTitle', "Human-readable context for when the view is moved out of its original location. By default, the view's container name will be used. Will be shown"),
type: 'string'
},
}
};
@@ -406,12 +417,14 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
? container.viewOrderDelegate.getOrder(item.group)
: undefined;
const icon = item.icon ? resources.joinPath(extension.description.extensionLocation, item.icon) : undefined;
const viewDescriptor = <ICustomViewDescriptor>{
id: item.id,
name: item.name,
ctorDescriptor: new SyncDescriptor(TreeViewPane),
when: ContextKeyExpr.deserialize(item.when),
containerIcon: viewContainer?.icon,
containerIcon: icon || viewContainer?.icon,
containerTitle: item.contextualTitle || viewContainer?.name,
canToggleVisibility: true,
canMoveView: true,
treeView: this.instantiationService.createInstance(CustomTreeView, item.id, item.name),
@@ -468,6 +481,14 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
collector.error(localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'when'));
return false;
}
if (descriptor.icon && typeof descriptor.icon !== 'string') {
collector.error(localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'icon'));
return false;
}
if (descriptor.contextualTitle && typeof descriptor.contextualTitle !== 'string') {
collector.error(localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'contextualTitle'));
return false;
}
}
return true;