提交 0d327988 编写于 作者: S Sandeep Somavarapu

Adopt to multiple local extensions

上级 aa3d6583
......@@ -8,7 +8,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import { Event } from 'vs/base/common/event';
import { TPromise } from 'vs/base/common/winjs.base';
import { IPager } from 'vs/base/common/paging';
import { IQueryOptions, IExtensionManifest, LocalExtensionType, EnablementState, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IQueryOptions, IExtensionManifest, LocalExtensionType, EnablementState, ILocalExtension, IGalleryExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IViewContainersRegistry, ViewContainer, Extensions as ViewContainerExtensions } from 'vs/workbench/common/views';
import { Registry } from 'vs/platform/registry/common/platform';
......@@ -39,7 +39,6 @@ export interface IExtension {
latestVersion: string;
description: string;
url: string;
downloadUrl: string;
repository: string;
iconUrl: string;
iconUrlFallback: string;
......@@ -56,6 +55,8 @@ export interface IExtension {
getReadme(): TPromise<string>;
getChangelog(): TPromise<string>;
local?: ILocalExtension;
locals?: ILocalExtension[];
gallery?: IGalleryExtension;
isMalicious: boolean;
}
......
......@@ -370,8 +370,8 @@ export class ExtensionEditor extends BaseEditor {
const maliciousStatusAction = this.instantiationService.createInstance(MaliciousStatusLabelAction, true);
const disabledStatusAction = this.instantiationService.createInstance(DisabledStatusLabelAction);
const installAction = servers.length === 1 ? this.instantiationService.createInstance(CombinedInstallAction, servers[0]) : this.instantiationService.createInstance(MultiServerInstallAction);
const updateAction = servers.length === 1 ? this.instantiationService.createInstance(UpdateAction, servers[0]) : this.instantiationService.createInstance(MultiServerUpdateAction);
const installAction = servers.length === 1 ? this.instantiationService.createInstance(CombinedInstallAction) : this.instantiationService.createInstance(MultiServerInstallAction);
const updateAction = servers.length === 1 ? this.instantiationService.createInstance(UpdateAction) : this.instantiationService.createInstance(MultiServerUpdateAction);
const enableAction = this.instantiationService.createInstance(EnableAction);
const disableAction = this.instantiationService.createInstance(DisableAction);
const reloadAction = this.instantiationService.createInstance(ReloadAction);
......
......@@ -106,9 +106,9 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
const maliciousStatusAction = this.instantiationService.createInstance(MaliciousStatusLabelAction, false);
const disabledStatusAction = this.instantiationService.createInstance(DisabledStatusLabelAction);
const installAction = this.extensionManagementServerService.extensionManagementServers.length === 1 ? this.instantiationService.createInstance(InstallAction, this.extensionManagementServerService.extensionManagementServers[0])
const installAction = this.extensionManagementServerService.extensionManagementServers.length === 1 ? this.instantiationService.createInstance(InstallAction)
: this.instantiationService.createInstance(MultiServerInstallAction);
const updateAction = this.extensionManagementServerService.extensionManagementServers.length === 1 ? this.instantiationService.createInstance(UpdateAction, this.extensionManagementServerService.extensionManagementServers[0])
const updateAction = this.extensionManagementServerService.extensionManagementServers.length === 1 ? this.instantiationService.createInstance(UpdateAction)
: this.instantiationService.createInstance(MultiServerUpdateAction);
const reloadAction = this.instantiationService.createInstance(ReloadAction);
const manageAction = this.instantiationService.createInstance(ManageExtensionAction);
......
......@@ -120,14 +120,6 @@ class Extension implements IExtension {
return `${product.extensionsGallery.itemUrl}?itemName=${this.publisher}.${this.name}`;
}
get downloadUrl(): string {
if (!product.extensionsGallery) {
return null;
}
return `${product.extensionsGallery.serviceUrl}/publishers/${this.publisher}/vsextensions/${this.name}/${this.latestVersion}/vspackage`;
}
get iconUrl(): string {
return this.galleryIconUrl || this.localIconUrl || this.defaultIconUrl;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册