#43645 Prepare for activity groups contribution

This commit is contained in:
Sandeep Somavarapu
2018-04-16 16:11:34 +02:00
parent 6c223050d7
commit 20acc5ec9f
4 changed files with 26 additions and 28 deletions

View File

@@ -83,6 +83,14 @@ namespace schema {
};
}
function getViewLocation(value: string): ViewLocation {
switch (value) {
case 'explorer': return ViewLocation.Explorer;
case 'debug': return ViewLocation.Debug;
default: return ViewLocation.get(`workbench.view.extension.${value}`) || ViewLocation.Explorer;
}
}
ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyViewDescriptor[] }>('views', [], schema.viewsContribution)
.setHandler((extensions) => {
for (let extension of extensions) {
@@ -93,12 +101,7 @@ ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyV
return;
}
const location = ViewLocation.getContributedViewLocation(entry.key);
if (!location) {
collector.warn(localize('locationId.invalid', "`{0}` is not a valid view location", entry.key));
return;
}
const location = getViewLocation(entry.key);
const registeredViews = ViewsRegistry.getViews(location);
const viewIds = [];
const viewDescriptors = coalesce(entry.value.map(item => {
@@ -129,4 +132,4 @@ ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyV
ViewsRegistry.registerViews(viewDescriptors);
});
}
});
});