This commit is contained in:
Sandeep Somavarapu 2020-11-30 11:58:43 +01:00
parent a5a37240bc
commit 2890fd321f
3 changed files with 10 additions and 2 deletions

View file

@ -173,6 +173,10 @@ export class ActionWithDropDownAction extends ExtensionAction {
private _menuActions: IAction[] = [];
get menuActions(): IAction[] { return [...this._menuActions]; }
get extension(): IExtension | null {
return super.extension;
}
set extension(extension: IExtension | null) {
this.actions.forEach(a => a.extension = extension);
super.extension = extension;
@ -1052,6 +1056,7 @@ export class EnableForWorkspaceAction extends ExtensionAction {
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService
) {
super(EnableForWorkspaceAction.ID, EnableForWorkspaceAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
this.tooltip = localize('enableForWorkspaceActionToolTip', "Enable this extension only in this workspace");
this.update();
}
@ -1082,6 +1087,7 @@ export class EnableGloballyAction extends ExtensionAction {
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService
) {
super(EnableGloballyAction.ID, EnableGloballyAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
this.tooltip = localize('enableGloballyActionToolTip', "Enable this extension");
this.update();
}
@ -1113,6 +1119,7 @@ export class DisableForWorkspaceAction extends ExtensionAction {
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService
) {
super(DisableForWorkspaceAction.ID, DisableForWorkspaceAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
this.tooltip = localize('disableForWorkspaceActionToolTip', "Disable this extension only in this workspace");
this.update();
}
@ -1149,6 +1156,7 @@ export class DisableGloballyAction extends ExtensionAction {
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService
) {
super(DisableGloballyAction.ID, DisableGloballyAction.LABEL, ExtensionAction.LABEL_ACTION_CLASS);
this.tooltip = localize('disableGloballyActionToolTip', "Disable this extension");
this.update();
}

View file

@ -130,7 +130,7 @@ export class ExtensionContainers extends Disposable {
for (const container of this.containers) {
if (extension && container.extension) {
if (areSameExtensions(container.extension.identifier, extension.identifier)) {
if (!container.extension.server || !extension.server || container.extension.server === extension.server) {
if (!container.extension.server || !extension.server || container.extension.server === extension.server || (!!container.extension.local !== !!extension.local)) {
container.extension = extension;
} else if (container.updateWhenCounterExtensionChanges) {
container.update();

View file

@ -37,6 +37,6 @@ export class Extensions extends Viewlet {
async installExtension(id: string): Promise<void> {
await this.searchForExtension(id);
await this.code.waitAndClick(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"] .extension-list-item .monaco-action-bar .action-item:not(.disabled) .extension-action.install`);
await this.code.waitForElement(`.extension-editor .monaco-action-bar .action-item:not(.disabled) .extension-action.uninstall`);
await this.code.waitForElement(`.extension-editor .monaco-action-bar .action-item:not(.disabled) .extension-action[title="Disable this extension"]`);
}
}