Skip to content

Commit

Permalink
Remove unused code in extensionsActions microsoft#38414
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Nov 20, 2017
1 parent d3df83b commit 713bb63
Showing 1 changed file with 7 additions and 39 deletions.
46 changes: 7 additions & 39 deletions src/vs/workbench/parts/extensions/browser/extensionsActions.ts
Expand Up @@ -1020,10 +1020,6 @@ export class ShowOutdatedExtensionsAction extends Action {
viewlet.focus();
});
}

protected isEnabled(): boolean {
return true;
}
}

export class ShowPopularExtensionsAction extends Action {
Expand All @@ -1047,10 +1043,6 @@ export class ShowPopularExtensionsAction extends Action {
viewlet.focus();
});
}

protected isEnabled(): boolean {
return true;
}
}

export class ShowRecommendedExtensionsAction extends Action {
Expand All @@ -1074,10 +1066,6 @@ export class ShowRecommendedExtensionsAction extends Action {
viewlet.focus();
});
}

protected isEnabled(): boolean {
return true;
}
}

export class InstallWorkspaceRecommendedExtensionsAction extends Action {
Expand Down Expand Up @@ -1151,10 +1139,6 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action {
});
}

protected isEnabled(): boolean {
return this.enabled;
}

dispose(): void {
this.disposables = dispose(this.disposables);
super.dispose();
Expand All @@ -1167,6 +1151,7 @@ export class InstallRecommendedExtensionAction extends Action {
static LABEL = localize('installRecommendedExtension', "Install Recommended Extension");

private extensionId: string;
private disposables: IDisposable[] = [];

constructor(
extensionId: string,
Expand All @@ -1176,6 +1161,11 @@ export class InstallRecommendedExtensionAction extends Action {
) {
super(InstallRecommendedExtensionAction.ID, InstallRecommendedExtensionAction.LABEL, null);
this.extensionId = extensionId;
this.extensionsWorkbenchService.onChange(() => this.update(), this, this.disposables);
}

private update(): void {
this.enabled = !this.extensionsWorkbenchService.local.some(x => x.id.toLowerCase() === this.extensionId.toLowerCase());
}

run(): TPromise<any> {
Expand All @@ -1198,11 +1188,8 @@ export class InstallRecommendedExtensionAction extends Action {
});
}

protected isEnabled(): boolean {
return !this.extensionsWorkbenchService.local.some(x => x.id.toLowerCase() === this.extensionId.toLowerCase());
}

dispose(): void {
this.disposables = dispose(this.disposables);
super.dispose();
}
}
Expand All @@ -1211,7 +1198,6 @@ export class InstallRecommendedExtensionAction extends Action {
export class ShowRecommendedKeymapExtensionsAction extends Action {

static ID = 'workbench.extensions.action.showRecommendedKeymapExtensions';
static LABEL = localize('showRecommendedKeymapExtensions', "Show Recommended Keymaps");
static SHORT_LABEL = localize('showRecommendedKeymapExtensionsShort', "Keymaps");

constructor(
Expand All @@ -1230,16 +1216,11 @@ export class ShowRecommendedKeymapExtensionsAction extends Action {
viewlet.focus();
});
}

protected isEnabled(): boolean {
return true;
}
}

export class ShowLanguageExtensionsAction extends Action {

static ID = 'workbench.extensions.action.showLanguageExtensions';
static LABEL = localize('showLanguageExtensions', "Show Language Extensions");
static SHORT_LABEL = localize('showLanguageExtensionsShort', "Language Extensions");

constructor(
Expand All @@ -1258,16 +1239,11 @@ export class ShowLanguageExtensionsAction extends Action {
viewlet.focus();
});
}

protected isEnabled(): boolean {
return true;
}
}

export class ShowAzureExtensionsAction extends Action {

static ID = 'workbench.extensions.action.showAzureExtensions';
static LABEL = localize('showAzureExtensions', "Show Azure Extensions");
static SHORT_LABEL = localize('showAzureExtensionsShort', "Azure Extensions");

constructor(
Expand All @@ -1286,10 +1262,6 @@ export class ShowAzureExtensionsAction extends Action {
viewlet.focus();
});
}

protected isEnabled(): boolean {
return true;
}
}

export class ChangeSortAction extends Action {
Expand Down Expand Up @@ -1329,10 +1301,6 @@ export class ChangeSortAction extends Action {
viewlet.focus();
});
}

protected isEnabled(): boolean {
return true;
}
}

interface IExtensionsContent {
Expand Down

0 comments on commit 713bb63

Please sign in to comment.