Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Bicker <jan.bicker@typefox.io>
  • Loading branch information
jbicker committed Dec 4, 2019
1 parent 1345c06 commit 4752d5f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ export class VSXRegistryWidget extends ViewContainer {
});

const onDidChange = this.service.onDidUpdateSearch;
this.toolbarRegistry.registerItem({
this.toDispose.push(this.toolbarRegistry.registerItem({
id: VSCodeExtensionsCommands.CLEAR_ALL.id,
command: VSCodeExtensionsCommands.CLEAR_ALL.id,
tooltip: VSCodeExtensionsCommands.CLEAR_ALL.label,
priority: 1,
onDidChange
});
}));

this.progressLocation = 'vsx-registry-list';
const onProgress = this.progressLocationService.onProgress(this.progressLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class VSXRegistryContribution extends AbstractViewContribution<VSXRegistr
area: 'left',
rank: 500
},
toggleCommandId: 'vsCodeExtensionsView:toggle',
toggleCommandId: 'vsxRegistryView:toggle',
toggleKeybinding: 'ctrlcmd+shift+x'
});
}
Expand Down
35 changes: 19 additions & 16 deletions packages/vsx-registry/src/browser/vsx-registry-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { ContainerModule } from 'inversify';
import { ContainerModule, interfaces } from 'inversify';
import { WidgetFactory, bindViewContribution, FrontendApplicationContribution, ViewContainerIdentifier, OpenHandler } from '@theia/core/lib/browser';
import { VSXRegistryWidget, VSXRegistryInstalledList, VSXRegistryList } from './view/list/vsx-registry-widget';
import { VSXRegistryContribution } from './vsx-registry-contribution';
Expand All @@ -38,25 +38,11 @@ export default new ContainerModule(bind => {
bind(VSXRegistryModel).toSelf().inSingletonScope();
bind(VSXRegistryAPI).toSelf().inSingletonScope();

bind(VSXRegistryInstalledList).toDynamicValue(({ container }) =>
VSXRegistryListWidget.createWidget(container,
{
id: 'installed_extension_list',
label: 'Installed Extensions',
location: 'installed'
}));
bind(VSXRegistryList).toDynamicValue(({ container }) =>
VSXRegistryListWidget.createWidget(container,
{
id: 'extension_list',
label: 'Open VSX Registry',
location: 'registry'
}));

bind(WidgetFactory).toDynamicValue(ctx => ({
id: VSXRegistryWidget.ID,
createWidget: async () => {
const container = ctx.container.createChild();
bindViewContainer(container);
container.bind(ViewContainerIdentifier).toConstantValue({ id: VSXRegistryWidget.ID });
container.bind(VSXRegistryWidget).toSelf().inSingletonScope();
return container.get(VSXRegistryWidget);
Expand All @@ -71,3 +57,20 @@ export default new ContainerModule(bind => {

bindVSXRegistryPreferences(bind);
});

export function bindViewContainer(parent: interfaces.Container): void {
parent.bind(VSXRegistryInstalledList).toDynamicValue(({ container }) =>
VSXRegistryListWidget.createWidget(container,
{
id: 'installed_extension_list',
label: 'Installed Extensions',
location: 'installed'
}));
parent.bind(VSXRegistryList).toDynamicValue(({ container }) =>
VSXRegistryListWidget.createWidget(container,
{
id: 'extension_list',
label: 'Open VSX Registry',
location: 'registry'
}));
}

0 comments on commit 4752d5f

Please sign in to comment.