Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/vs/workbench/api/browser/viewsExtensionPoint.ts')
-rw-r--r--src/vs/workbench/api/browser/viewsExtensionPoint.ts27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts
index 1932e2ce93d..b94fab104e1 100644
--- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts
+++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import { coalesce } from 'vs/base/common/arrays';
-import { forEach } from 'vs/base/common/collections';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import * as resources from 'vs/base/common/resources';
import { isFalsyOrWhitespace } from 'vs/base/common/strings';
@@ -322,16 +321,16 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
let activityBarOrder = CUSTOM_VIEWS_START_ORDER + viewContainersRegistry.all.filter(v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.Sidebar).length;
let panelOrder = 5 + viewContainersRegistry.all.filter(v => !!v.extensionId && viewContainersRegistry.getViewContainerLocation(v) === ViewContainerLocation.Panel).length + 1;
for (const { value, collector, description } of extensionPoints) {
- forEach(value, entry => {
- if (!this.isValidViewsContainer(entry.value, collector)) {
+ Object.entries(value).forEach(([key, value]) => {
+ if (!this.isValidViewsContainer(value, collector)) {
return;
}
- switch (entry.key) {
+ switch (key) {
case 'activitybar':
- activityBarOrder = this.registerCustomViewContainers(entry.value, description, activityBarOrder, existingViewContainers, ViewContainerLocation.Sidebar);
+ activityBarOrder = this.registerCustomViewContainers(value, description, activityBarOrder, existingViewContainers, ViewContainerLocation.Sidebar);
break;
case 'panel':
- panelOrder = this.registerCustomViewContainers(entry.value, description, panelOrder, existingViewContainers, ViewContainerLocation.Panel);
+ panelOrder = this.registerCustomViewContainers(value, description, panelOrder, existingViewContainers, ViewContainerLocation.Panel);
break;
}
});
@@ -455,22 +454,22 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
for (const extension of extensions) {
const { value, collector } = extension;
- forEach(value, entry => {
- if (!this.isValidViewDescriptors(entry.value, collector)) {
+ Object.entries(value).forEach(([key, value]) => {
+ if (!this.isValidViewDescriptors(value, collector)) {
return;
}
- if (entry.key === 'remote' && !isProposedApiEnabled(extension.description, 'contribViewsRemote')) {
- collector.warn(localize('ViewContainerRequiresProposedAPI', "View container '{0}' requires 'enabledApiProposals: [\"contribViewsRemote\"]' to be added to 'Remote'.", entry.key));
+ if (key === 'remote' && !isProposedApiEnabled(extension.description, 'contribViewsRemote')) {
+ collector.warn(localize('ViewContainerRequiresProposedAPI', "View container '{0}' requires 'enabledApiProposals: [\"contribViewsRemote\"]' to be added to 'Remote'.", key));
return;
}
- const viewContainer = this.getViewContainer(entry.key);
+ const viewContainer = this.getViewContainer(key);
if (!viewContainer) {
- collector.warn(localize('ViewContainerDoesnotExist', "View container '{0}' does not exist and all views registered to it will be added to 'Explorer'.", entry.key));
+ collector.warn(localize('ViewContainerDoesnotExist', "View container '{0}' does not exist and all views registered to it will be added to 'Explorer'.", key));
}
const container = viewContainer || this.getDefaultViewContainer();
- const viewDescriptors = coalesce(entry.value.map((item, index) => {
+ const viewDescriptors = coalesce(value.map((item, index) => {
// validate
if (viewIds.has(item.id)) {
collector.error(localize('duplicateView1', "Cannot register multiple views with same id `{0}`", item.id));
@@ -514,7 +513,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
collapsed: this.showCollapsed(container) || initialVisibility === InitialVisibility.Collapsed,
order: order,
extensionId: extension.description.identifier,
- originalContainerId: entry.key,
+ originalContainerId: key,
group: item.group,
remoteAuthority: item.remoteName || (<any>item).remoteAuthority, // TODO@roblou - delete after remote extensions are updated
hideByDefault: initialVisibility === InitialVisibility.Hidden,