Show the custom views contributed to custom view container by the same extension on the top

This commit is contained in:
Sandeep Somavarapu
2018-08-22 10:20:09 +02:00
parent 7bc7034b65
commit df2ecbfd07
3 changed files with 11 additions and 10 deletions

View File

@@ -113,7 +113,7 @@ class ViewsContainersExtensionHandler implements IWorkbenchContribution {
}
const registeredViews = ViewsRegistry.getViews(container);
const viewIds = [];
const viewDescriptors = coalesce(entry.value.map(item => {
const viewDescriptors = coalesce(entry.value.map((item, index) => {
// validate
if (viewIds.indexOf(item.id) !== -1) {
collector.error(localize('duplicateView1', "Cannot register multiple views with same id `{0}` in the view container `{1}`", item.id, container.id));
@@ -132,7 +132,8 @@ class ViewsContainersExtensionHandler implements IWorkbenchContribution {
when: ContextKeyExpr.deserialize(item.when),
canToggleVisibility: true,
collapsed: this.showCollapsed(container),
treeViewer: this.instantiationService.createInstance(CustomTreeViewer, item.id, container)
treeViewer: this.instantiationService.createInstance(CustomTreeViewer, item.id, container),
order: extension.description.id === container.extensionId ? index + 1 : void 0
};
viewIds.push(viewDescriptor.id);