提交 8572f720 编写于 作者: J Joao Moreno

naming

上级 386a1301
......@@ -55,10 +55,10 @@ export class InstallExtensionAction extends Action {
}
}
export class ListExtensionsUpdatesAction extends Action {
export class ListOutdatedExtensionsAction extends Action {
static ID = 'workbench.extensions.action.listExtensionsUpdates';
static LABEL = nls.localize('showExtensionsUpdates', "Show Extensions Updates");
static ID = 'workbench.extensions.action.listOutdatedExtensions';
static LABEL = nls.localize('showOutdatedExtensions', "Show Outdated Extensions");
constructor(
id: string,
......
......@@ -475,7 +475,7 @@ export class GalleryExtensionsHandler extends QuickOpenHandler {
}
}
class ExtensionsUpdateModel implements IModel<IExtensionEntry> {
class OutdatedExtensionsModel implements IModel<IExtensionEntry> {
public dataSource = new DataSource();
public renderer: IRenderer<IExtensionEntry>;
......@@ -499,20 +499,18 @@ class ExtensionsUpdateModel implements IModel<IExtensionEntry> {
const local = this.localExtensions.filter(local => extensionEquals(local, extension))[0];
return local && semver.lt(local.version, extension.version) && !!highlights;
})
.map(({ extension, highlights }: { extension: IExtension, highlights: IHighlights }) => {
return {
extension,
highlights,
state: ExtensionState.Outdated
};
})
.map(({ extension, highlights }: { extension: IExtension, highlights: IHighlights }) => ({
extension,
highlights,
state: ExtensionState.Outdated
}))
.sort((a, b) => a.extension.name.localeCompare(b.extension.name));
}
}
export class ExtensionsUpdateHandler extends QuickOpenHandler {
export class OutdatedExtensionsHandler extends QuickOpenHandler {
private modelPromise: TPromise<ExtensionsUpdateModel>;
private modelPromise: TPromise<OutdatedExtensionsModel>;
constructor(
@IInstantiationService private instantiationService: IInstantiationService,
......@@ -527,7 +525,7 @@ export class ExtensionsUpdateHandler extends QuickOpenHandler {
if (!this.modelPromise) {
this.telemetryService.publicLog('extensionGallery:open');
this.modelPromise = TPromise.join<any>([this.galleryService.query(), this.extensionsService.getInstalled()])
.then(result => this.instantiationService.createInstance(ExtensionsUpdateModel, result[0], result[1]));
.then(result => this.instantiationService.createInstance(OutdatedExtensionsModel, result[0], result[1]));
}
return this.modelPromise.then(model => {
......
......@@ -16,7 +16,7 @@ import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common
import { ReloadWindowAction } from 'vs/workbench/electron-browser/actions';
import wbaregistry = require('vs/workbench/browser/actionRegistry');
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { ListExtensionsAction, InstallExtensionAction, ListExtensionsUpdatesAction } from './extensionsActions';
import { ListExtensionsAction, InstallExtensionAction, ListOutdatedExtensionsAction } from './extensionsActions';
import { IQuickOpenRegistry, Extensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen';
import ipc = require('ipc');
......@@ -68,14 +68,14 @@ export class ExtensionsWorkbenchExtension implements IWorkbenchContribution {
)
);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ListExtensionsUpdatesAction, ListExtensionsUpdatesAction.ID, ListExtensionsUpdatesAction.LABEL), extensionsCategory);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ListOutdatedExtensionsAction, ListOutdatedExtensionsAction.ID, ListOutdatedExtensionsAction.LABEL), extensionsCategory);
(<IQuickOpenRegistry>platform.Registry.as(Extensions.Quickopen)).registerQuickOpenHandler(
new QuickOpenHandlerDescriptor(
'vs/workbench/parts/extensions/electron-browser/extensionsQuickOpen',
'ExtensionsUpdateHandler',
'OutdatedExtensionsHandler',
'ext update ',
nls.localize('extensionsUpdateCommands', "Extensions Update Commands"),
nls.localize('outdatedExtensionsCommands', "Outdated Extensions Commands"),
true
)
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册