mirror of
https://github.com/Microsoft/vscode
synced 2024-10-13 14:57:14 +00:00
parent
746f66a6e7
commit
2f8e7a9e18
|
@ -21,7 +21,7 @@ import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/co
|
|||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { VIEWLET_ID, IExtensionsWorkbenchService } from './extensions';
|
||||
import { ExtensionsWorkbenchService } from './extensionsWorkbenchService';
|
||||
import { OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowPopularExtensionsAction, ShowInstalledExtensionsAction } from './extensionsActions';
|
||||
import { OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowPopularExtensionsAction, ShowInstalledExtensionsAction, UpdateAllAction } from './extensionsActions';
|
||||
import { ExtensionsInput } from './extensionsInput';
|
||||
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor } from 'vs/workbench/browser/viewlet';
|
||||
import { ExtensionEditor } from './extensionEditor';
|
||||
|
@ -109,6 +109,9 @@ actionRegistry.registerWorkbenchAction(popularActionDescriptor, `Extensions: ${
|
|||
const installedActionDescriptor = new SyncActionDescriptor(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(installedActionDescriptor, `Extensions: ${ ShowInstalledExtensionsAction.LABEL }`, ExtensionsLabel);
|
||||
|
||||
const updateAllActionDescriptor = new SyncActionDescriptor(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(updateAllActionDescriptor, `Extensions: ${ UpdateAllAction.LABEL }`, ExtensionsLabel);
|
||||
|
||||
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
|
||||
.registerConfiguration({
|
||||
id: 'extensions',
|
||||
|
|
|
@ -264,12 +264,17 @@ export class EnableAction extends Action {
|
|||
|
||||
export class UpdateAllAction extends Action {
|
||||
|
||||
static ID = 'extensions.update-all';
|
||||
static LABEL = localize('updateAll', "Update All Extensions");
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
|
||||
constructor(
|
||||
id = UpdateAllAction.ID,
|
||||
label = UpdateAllAction.LABEL,
|
||||
@IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService
|
||||
) {
|
||||
super('extensions.update-all', localize('updateAll', "Update All Extensions"), '', false);
|
||||
super(id, label, '', false);
|
||||
|
||||
this.disposables.push(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
this.update();
|
||||
|
|
|
@ -164,7 +164,7 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet {
|
|||
getSecondaryActions(): IAction[] {
|
||||
if (!this.secondaryActions) {
|
||||
this.secondaryActions = [
|
||||
this.instantiationService.createInstance(UpdateAllAction),
|
||||
this.instantiationService.createInstance(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL),
|
||||
new Separator(),
|
||||
this.instantiationService.createInstance(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL),
|
||||
this.instantiationService.createInstance(ShowOutdatedExtensionsAction, ShowOutdatedExtensionsAction.ID, ShowOutdatedExtensionsAction.LABEL),
|
||||
|
|
|
@ -316,7 +316,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
|
|||
return;
|
||||
}
|
||||
|
||||
const action = this.instantiationService.createInstance(UpdateAllAction);
|
||||
const action = this.instantiationService.createInstance(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL);
|
||||
return action.enabled && action.run();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue