提交 f024f256 编写于 作者: S Sandeep Somavarapu

Pass unregsitered views to super update views

上级 3ac58daa
......@@ -125,9 +125,9 @@ export const ViewsRegistry: IViewsRegistry = new class implements IViewsRegistry
this._views.delete(location);
this._viewLocations.splice(this._viewLocations.indexOf(location), 1);
}
this._onViewsDeregistered.fire(viewsToDeregister);
}
this._onViewsDeregistered.fire(viewsToDeregister);
}
getViews(loc: ViewLocation): IViewDescriptor[] {
......
......@@ -93,7 +93,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('marketPlace', "Marketplace"),
location: ViewLocation.Extensions,
ctor: ExtensionsListView,
when: ContextKeyExpr.and(ContextKeyExpr.has('searchExtensions'), ContextKeyExpr.not('searchInstalledExtensions'), ContextKeyExpr.not('searchBuiltInExtensions'), ContextKeyExpr.not('recommendedExtensions')),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchExtensions'), ContextKeyExpr.not('searchInstalledExtensions'), ContextKeyExpr.not('searchBuiltInExtensions'), ContextKeyExpr.not('recommendedExtensions')),
weight: 100
};
}
......@@ -104,7 +104,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('installedExtensions', "Installed"),
location: ViewLocation.Extensions,
ctor: InstalledExtensionsView,
when: ContextKeyExpr.and(ContextKeyExpr.not('searchExtensions')),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.not('searchExtensions')),
order: 1,
weight: 30
};
}
......@@ -115,7 +116,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('searchInstalledExtensions', "Installed"),
location: ViewLocation.Extensions,
ctor: InstalledExtensionsView,
when: ContextKeyExpr.and(ContextKeyExpr.has('searchInstalledExtensions')),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchInstalledExtensions')),
weight: 100
};
}
......@@ -126,8 +127,9 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('recommendedExtensions', "Recommended"),
location: ViewLocation.Extensions,
ctor: RecommendedExtensionsView,
when: ContextKeyExpr.and(ContextKeyExpr.not('searchExtensions'), ContextKeyExpr.has('defaultRecommendedExtensions')),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.not('searchExtensions'), ContextKeyExpr.has('defaultRecommendedExtensions')),
weight: 70,
order: 2,
canToggleVisibility: true
};
}
......@@ -138,7 +140,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('otherRecommendedExtensions', "Other Recommendations"),
location: ViewLocation.Extensions,
ctor: RecommendedExtensionsView,
when: ContextKeyExpr.and(ContextKeyExpr.has('recommendedExtensions')),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('recommendedExtensions')),
weight: 50,
canToggleVisibility: true,
order: 2
......@@ -151,7 +153,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('workspaceRecommendedExtensions', "Workspace Recommendations"),
location: ViewLocation.Extensions,
ctor: WorkspaceRecommendedExtensionsView,
when: ContextKeyExpr.and(ContextKeyExpr.has('recommendedExtensions'), ContextKeyExpr.has('nonEmptyWorkspace')),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('recommendedExtensions'), ContextKeyExpr.has('nonEmptyWorkspace')),
weight: 50,
canToggleVisibility: true,
order: 1
......@@ -164,7 +166,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('builtInExtensions', "Features"),
location: ViewLocation.Extensions,
ctor: BuiltInExtensionsView,
when: ContextKeyExpr.has('searchBuiltInExtensions'),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchBuiltInExtensions')),
weight: 100,
canToggleVisibility: true
};
......@@ -176,7 +178,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('builtInThemesExtensions', "Themes"),
location: ViewLocation.Extensions,
ctor: BuiltInThemesExtensionsView,
when: ContextKeyExpr.has('searchBuiltInExtensions'),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchBuiltInExtensions')),
weight: 100,
canToggleVisibility: true
};
......@@ -188,7 +190,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
name: localize('builtInBasicsExtensions', "Programming Languages"),
location: ViewLocation.Extensions,
ctor: BuiltInBasicsExtensionsView,
when: ContextKeyExpr.has('searchBuiltInExtensions'),
when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchBuiltInExtensions')),
weight: 100,
canToggleVisibility: true
};
......@@ -392,7 +394,7 @@ export class ExtensionsViewlet extends PersistentViewsViewlet implements IExtens
}
protected async updateViews(unregisteredViews: IViewDescriptor[] = [], showAll = false): TPromise<ViewsViewletPanel[]> {
const created = await super.updateViews();
const created = await super.updateViews(unregisteredViews);
const toShow = showAll ? this.views : created;
if (toShow.length) {
await this.progress(TPromise.join(toShow.map(view => (<ExtensionsListView>view).show(this.searchBox.value))));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册