提交 93ac85a3 编写于 作者: S Sandeep Somavarapu

Use identifier for id+uuid

上级 819b5061
......@@ -42,7 +42,7 @@ export interface IExtensionData {
export class DataSource implements IDataSource {
public getId(tree: ITree, { extension, parent }: IExtensionData): string {
return parent ? this.getId(tree, parent) + '/' + extension.id : extension.id;
return parent ? this.getId(tree, parent) + '/' + extension.identifier.id : extension.identifier.id;
}
public hasChildren(tree: ITree, { hasChildren }: IExtensionData): boolean {
......@@ -144,13 +144,13 @@ export class Renderer implements IRenderer {
}
data.name.textContent = extension.displayName;
data.identifier.textContent = extension.id;
data.identifier.textContent = extension.identifier.id;
data.author.textContent = extension.publisherDisplayName;
data.extensionData = extensionData;
}
private renderUnknownExtension(tree: ITree, { extension }: IExtensionData, data: IUnknownExtensionTemplateData): void {
data.identifier.textContent = extension.id;
data.identifier.textContent = extension.identifier.id;
}
public disposeTemplate(tree: ITree, templateId: string, templateData: any): void {
......
......@@ -7,7 +7,7 @@ import { IViewlet } from 'vs/workbench/common/viewlet';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { Event } from 'vs/base/common/event';
import { IPager } from 'vs/base/common/paging';
import { IQueryOptions, IExtensionManifest, LocalExtensionType, EnablementState, ILocalExtension, IGalleryExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IQueryOptions, IExtensionManifest, LocalExtensionType, EnablementState, ILocalExtension, IGalleryExtension, IExtensionIdentifier } 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';
import { CancellationToken } from 'vs/base/common/cancellation';
......@@ -31,8 +31,7 @@ export interface IExtension {
state: ExtensionState;
name: string;
displayName: string;
id: string;
uuid?: string;
identifier: IExtensionIdentifier;
publisher: string;
publisherDisplayName: string;
version: string;
......
......@@ -49,7 +49,7 @@ export class ExtensionsInput extends EditorInput {
getResource(): URI {
return URI.from({
scheme: 'extension',
path: this.extension.id
path: this.extension.identifier.id
});
}
}
\ No newline at end of file
......@@ -289,7 +289,7 @@ export class ExtensionEditor extends BaseEditor {
this.icon.src = extension.iconUrl;
this.name.textContent = extension.displayName;
this.identifier.textContent = extension.id;
this.identifier.textContent = extension.identifier.id;
this.preview.style.display = extension.preview ? 'inherit' : 'none';
this.builtin.style.display = extension.type === LocalExtensionType.System ? 'inherit' : 'none';
......@@ -298,8 +298,8 @@ export class ExtensionEditor extends BaseEditor {
const extRecommendations = this.extensionTipsService.getAllRecommendationsWithReason();
let recommendationsData = {};
if (extRecommendations[extension.id.toLowerCase()]) {
recommendationsData = { recommendationReason: extRecommendations[extension.id.toLowerCase()].reasonId };
if (extRecommendations[extension.identifier.id.toLowerCase()]) {
recommendationsData = { recommendationReason: extRecommendations[extension.identifier.id.toLowerCase()].reasonId };
}
/* __GDPR__
......@@ -418,11 +418,11 @@ export class ExtensionEditor extends BaseEditor {
this.transientDisposables.push(ignoreAction, undoIgnoreAction);
const extRecommendations = this.extensionTipsService.getAllRecommendationsWithReason();
if (extRecommendations[extension.id.toLowerCase()]) {
if (extRecommendations[extension.identifier.id.toLowerCase()]) {
ignoreAction.enabled = true;
this.subtext.textContent = extRecommendations[extension.id.toLowerCase()].reasonText;
this.subtext.textContent = extRecommendations[extension.identifier.id.toLowerCase()].reasonText;
show(this.subtextContainer);
} else if (this.extensionTipsService.getAllIgnoredRecommendations().global.indexOf(extension.id.toLowerCase()) !== -1) {
} else if (this.extensionTipsService.getAllIgnoredRecommendations().global.indexOf(extension.identifier.id.toLowerCase()) !== -1) {
undoIgnoreAction.enabled = true;
this.subtext.textContent = localize('recommendationHasBeenIgnored', "You have chosen not to receive recommendations for this extension.");
show(this.subtextContainer);
......@@ -432,13 +432,13 @@ export class ExtensionEditor extends BaseEditor {
}
this.extensionTipsService.onRecommendationChange(change => {
if (change.extensionId.toLowerCase() === extension.id.toLowerCase()) {
if (change.extensionId.toLowerCase() === extension.identifier.id.toLowerCase()) {
if (change.isRecommended) {
undoIgnoreAction.enabled = false;
const extRecommendations = this.extensionTipsService.getAllRecommendationsWithReason();
if (extRecommendations[extension.id.toLowerCase()]) {
if (extRecommendations[extension.identifier.id.toLowerCase()]) {
ignoreAction.enabled = true;
this.subtext.textContent = extRecommendations[extension.id.toLowerCase()].reasonText;
this.subtext.textContent = extRecommendations[extension.identifier.id.toLowerCase()].reasonText;
}
} else {
undoIgnoreAction.enabled = true;
......
......@@ -635,8 +635,8 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
recommendationsToSuggest = recommendationsToSuggest.filter(id => importantRecommendationsIgnoreList.indexOf(id) === -1 && this.isExtensionAllowedToBeRecommended(id));
const importantTipsPromise = recommendationsToSuggest.length === 0 ? Promise.resolve(null) : this.extensionWorkbenchService.queryLocal().then(local => {
const localExtensions = local.map(e => e.id);
recommendationsToSuggest = recommendationsToSuggest.filter(id => localExtensions.every(local => local !== id.toLowerCase()));
const localExtensions = local.map(e => e.identifier);
recommendationsToSuggest = recommendationsToSuggest.filter(id => localExtensions.every(local => !areSameExtensions(local, { id })));
if (!recommendationsToSuggest.length) {
return;
}
......
......@@ -247,7 +247,7 @@ jsonRegistry.registerSchema(ExtensionsConfigurationSchemaId, ExtensionsConfigura
// Register Commands
CommandsRegistry.registerCommand('_extensions.manage', (accessor: ServicesAccessor, extensionId: string) => {
const extensionService = accessor.get(IExtensionsWorkbenchService);
const extension = extensionService.local.filter(e => areSameExtensions(e, { id: extensionId }));
const extension = extensionService.local.filter(e => areSameExtensions(e.identifier, { id: extensionId }));
if (extension.length === 1) {
extensionService.open(extension[0]);
}
......
......@@ -158,7 +158,7 @@ export class InstallAction extends Action {
return;
}
if (extension && !areSameExtensions(this.extension, extension)) {
if (extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
......@@ -193,7 +193,7 @@ export class InstallAction extends Action {
console.error(err);
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.id), err, this.instantiationService, this.notificationService, this.openerService);
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService);
});
}
......@@ -231,7 +231,7 @@ export class UninstallAction extends Action {
return;
}
if (extension && !areSameExtensions(this.extension, extension)) {
if (extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
......@@ -247,7 +247,7 @@ export class UninstallAction extends Action {
this.label = UninstallAction.UninstallLabel;
this.class = UninstallAction.UninstallClass;
const installedExtensions = this.extensionsWorkbenchService.local.filter(e => e.id === this.extension.id);
const installedExtensions = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension.identifier));
if (!installedExtensions.length) {
this.enabled = false;
......@@ -386,7 +386,7 @@ export class UpdateAction extends Action {
return;
}
if (extension && !areSameExtensions(this.extension, extension)) {
if (extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
......@@ -420,7 +420,7 @@ export class UpdateAction extends Action {
console.error(err);
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.id), err, this.instantiationService, this.notificationService, this.openerService);
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService);
});
}
......@@ -568,7 +568,7 @@ export class ManageExtensionAction extends DropDownAction {
this.disposables.push(extensionsWorkbenchService.onChange(extension => {
if (extension && this.extension) {
if (areSameExtensions(this.extension, extension)) {
if (areSameExtensions(this.extension.identifier, extension.identifier)) {
this.extension = extension;
}
} else {
......@@ -650,7 +650,7 @@ export class InstallAnotherVersionAction extends Action {
console.error(err);
return promptDownloadManually(this.extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", this.extension.id), err, this.instantiationService, this.notificationService, this.openerService);
return promptDownloadManually(this.extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", this.extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService);
});
}
return null;
......@@ -673,14 +673,14 @@ export class ExtensionInfoAction extends Action implements IExtensionAction {
}
run(): Promise<any> {
const { description, version, publisherDisplayName, id, displayName } = this.extension;
const { description, version, publisherDisplayName, identifier, displayName } = this.extension;
const localizedExtension = localize('extensionInfoName', 'Name') + ': ' + displayName;
const localizedExtensionId = localize('extensionInfoId', 'Id') + ': ' + id;
const localizedExtensionId = localize('extensionInfoId', 'Id') + ': ' + identifier.id;
const localizedDescription = localize('extensionInfoDescription', 'Description') + ': ' + description;
const localizedVersion = localize('extensionInfoVersion', 'Version') + ': ' + version;
const localizedPublisher = localize('extensionInfoPublisher', 'Publisher') + ': ' + publisherDisplayName;
const localizedVSMarketplaceLink = localize('extensionInfoVSMarketplaceLink', 'VS Marketplace Link') + ': https://marketplace.visualstudio.com/items?itemName=' + id;
const localizedVSMarketplaceLink = localize('extensionInfoVSMarketplaceLink', 'VS Marketplace Link') + ': https://marketplace.visualstudio.com/items?itemName=' + identifier.id;
const clipboardStr = `${localizedExtension}\n${localizedExtensionId}\n${localizedDescription}\n${localizedVersion}\n${localizedPublisher}\n${localizedVSMarketplaceLink}`;
......@@ -749,7 +749,7 @@ export class EnableForWorkspaceAction extends Action implements IExtensionAction
}
private update(extension?: IExtension): void {
if (extension && this.extension && !areSameExtensions(this.extension, extension)) {
if (extension && this.extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
this.enabled = false;
......@@ -791,7 +791,7 @@ export class InstallInRemoteServerAction extends Action implements IExtensionAct
}
private update(extension?: IExtension): void {
if (extension && this.extension && !areSameExtensions(this.extension, extension)) {
if (extension && this.extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
this.enabled = false;
......@@ -804,7 +804,7 @@ export class InstallInRemoteServerAction extends Action implements IExtensionAct
return !!server && server.authority === this.extensionManagementServerService.remoteExtensionManagementServer!.authority;
});
if (!installedInRemoteServer) {
this.enabled = !this.runningExtensions.some(e => areSameExtensions({ id: e.id }, { id: this.extension.id }));
this.enabled = !this.runningExtensions.some(e => areSameExtensions({ id: e.id }, this.extension.identifier));
}
}
}
......@@ -857,7 +857,7 @@ export class EnableGloballyAction extends Action implements IExtensionAction {
}
private update(extension?: IExtension): void {
if (extension && this.extension && !areSameExtensions(this.extension, extension)) {
if (extension && this.extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
this.enabled = false;
......@@ -902,11 +902,11 @@ export class DisableForWorkspaceAction extends Action implements IExtensionActio
}
private update(extension?: IExtension): void {
if (extension && this.extension && !areSameExtensions(this.extension, extension)) {
if (extension && this.extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
this.enabled = false;
if (this.extension && this.runningExtensions.some(e => areSameExtensions({ id: e.id }, { id: this.extension.id }) && this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY)) {
if (this.extension && this.runningExtensions.some(e => areSameExtensions({ id: e.id }, this.extension.identifier) && this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY)) {
this.enabled = this.extension.state === ExtensionState.Installed && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) && !!this.extension.local && this.extensionEnablementService.canChangeEnablement(this.extension.local);
}
}
......@@ -938,11 +938,11 @@ export class DisableGloballyAction extends Action implements IExtensionAction {
}
private update(extension?: IExtension): void {
if (extension && this.extension && !areSameExtensions(this.extension, extension)) {
if (extension && this.extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
this.enabled = false;
if (this.extension && this.runningExtensions.some(e => areSameExtensions({ id: e.id }, { id: this.extension.id }))) {
if (this.extension && this.runningExtensions.some(e => areSameExtensions({ id: e.id }, this.extension.identifier))) {
this.enabled = this.extension.state === ExtensionState.Installed && (this.extension.enablementState === EnablementState.Enabled || this.extension.enablementState === EnablementState.WorkspaceEnabled) && !!this.extension.local && this.extensionEnablementService.canChangeEnablement(this.extension.local);
}
}
......@@ -1180,7 +1180,7 @@ export class UpdateAllAction extends Action {
console.error(err);
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.id), err, this.instantiationService, this.notificationService, this.openerService);
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService);
});
}
......@@ -1218,7 +1218,7 @@ export class ReloadAction extends Action {
}
private update(extension?: IExtension): void {
if (extension && this.extension && !areSameExtensions(this.extension, extension)) {
if (extension && this.extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
this.throttler.queue(() => {
......@@ -1231,7 +1231,7 @@ export class ReloadAction extends Action {
if (state === ExtensionState.Installing || state === ExtensionState.Uninstalling) {
return Promise.resolve<void>();
}
const installed = this.extensionsWorkbenchService.local.filter(e => e.id === this.extension.id)[0];
const installed = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension.identifier))[0];
const local = this.extension.local || (installed && installed.local);
if (local && local.manifest && local.manifest.contributes && local.manifest.contributes.localizations && local.manifest.contributes.localizations.length > 0) {
return Promise.resolve<void>();
......@@ -1248,7 +1248,7 @@ export class ReloadAction extends Action {
const isUninstalled = this.extension.state === ExtensionState.Uninstalled;
const isDisabled = this.extension.local ? !this.extensionEnablementService.isEnabled(this.extension.local) : false;
const isEnabled = this.extension.local ? this.extensionEnablementService.isEnabled(this.extension.local) : false;
const runningExtension = runningExtensions.filter(e => areSameExtensions(e, this.extension))[0];
const runningExtension = runningExtensions.filter(e => areSameExtensions(e, this.extension.identifier))[0];
if (installed && installed.local) {
if (runningExtension) {
......@@ -1566,7 +1566,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action {
installPromises.push(model.resolve(i, CancellationToken.None).then(e => {
return this.extensionWorkbenchService.install(e).then(void 0, err => {
console.error(err);
return promptDownloadManually(e.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", e.id), err, this.instantiationService, this.notificationService, this.openerService);
return promptDownloadManually(e.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", e.identifier.id), err, this.instantiationService, this.notificationService, this.openerService);
});
}));
}
......@@ -1608,7 +1608,7 @@ export class InstallRecommendedExtensionAction extends Action {
return this.extensionWorkbenchService.install(extension)
.then(() => null, err => {
console.error(err);
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.id), err, this.instantiationService, this.notificationService, this.openerService);
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService);
});
}
return null;
......@@ -1637,7 +1637,7 @@ export class IgnoreExtensionRecommendationAction extends Action {
}
public run(): Promise<any> {
this.extensionsTipsService.toggleIgnoredRecommendation(this.extension.id, true);
this.extensionsTipsService.toggleIgnoredRecommendation(this.extension.identifier.id, true);
return Promise.resolve(null);
}
......@@ -1667,7 +1667,7 @@ export class UndoIgnoreExtensionRecommendationAction extends Action {
}
public run(): Promise<any> {
this.extensionsTipsService.toggleIgnoredRecommendation(this.extension.id, false);
this.extensionsTipsService.toggleIgnoredRecommendation(this.extension.identifier.id, false);
return Promise.resolve(null);
}
......@@ -2215,7 +2215,7 @@ export class AddToWorkspaceFolderRecommendationsAction extends AbstractConfigure
return Promise.resolve();
}
const extensionId = this.editorService.activeEditor.extension.id;
const extensionId = this.editorService.activeEditor.extension.identifier;
const pickFolderPromise = folders.length === 1
? Promise.resolve(folders[0])
: this.commandService.executeCommand<IWorkspaceFolder>(PICK_WORKSPACE_FOLDER_COMMAND_ID);
......@@ -2226,14 +2226,14 @@ export class AddToWorkspaceFolderRecommendationsAction extends AbstractConfigure
}
const configurationFile = workspaceFolder.toResource(paths.join('.vscode', 'extensions.json'));
return this.getWorkspaceFolderExtensionsConfigContent(configurationFile).then(content => {
const extensionIdLowerCase = extensionId.toLowerCase();
const extensionIdLowerCase = extensionId.id.toLowerCase();
if (shouldRecommend) {
if ((content.recommendations || []).some(e => e.toLowerCase() === extensionIdLowerCase)) {
this.notificationService.info(localize('AddToWorkspaceFolderRecommendations.alreadyExists', 'This extension is already present in this workspace folder\'s recommendations.'));
return Promise.resolve();
}
return this.addExtensionToWorkspaceFolderConfig(configurationFile, extensionId, shouldRecommend).then(() => {
return this.addExtensionToWorkspaceFolderConfig(configurationFile, extensionId.id, shouldRecommend).then(() => {
this.notificationService.prompt(Severity.Info,
localize('AddToWorkspaceFolderRecommendations.success', 'The extension was successfully added to this workspace folder\'s recommendations.'),
[{
......@@ -2250,7 +2250,7 @@ export class AddToWorkspaceFolderRecommendationsAction extends AbstractConfigure
return Promise.resolve();
}
return this.addExtensionToWorkspaceFolderConfig(configurationFile, extensionId, shouldRecommend).then(() => {
return this.addExtensionToWorkspaceFolderConfig(configurationFile, extensionId.id, shouldRecommend).then(() => {
this.notificationService.prompt(Severity.Info,
localize('AddToWorkspaceFolderIgnoredRecommendations.success', 'The extension was successfully added to this workspace folder\'s unwanted recommendations.'),
[{
......@@ -2294,17 +2294,17 @@ export class AddToWorkspaceRecommendationsAction extends AbstractConfigureRecomm
return Promise.resolve();
}
const extensionId = this.editorService.activeEditor.extension.id;
const extensionId = this.editorService.activeEditor.extension.identifier;
return this.getWorkspaceExtensionsConfigContent(workspaceConfig).then(content => {
const extensionIdLowerCase = extensionId.toLowerCase();
const extensionIdLowerCase = extensionId.id.toLowerCase();
if (shouldRecommend) {
if ((content.recommendations || []).some(e => e.toLowerCase() === extensionIdLowerCase)) {
this.notificationService.info(localize('AddToWorkspaceRecommendations.alreadyExists', 'This extension is already present in workspace recommendations.'));
return Promise.resolve();
}
return this.addExtensionToWorkspaceConfig(workspaceConfig, extensionId, shouldRecommend).then(() => {
return this.addExtensionToWorkspaceConfig(workspaceConfig, extensionId.id, shouldRecommend).then(() => {
this.notificationService.prompt(Severity.Info,
localize('AddToWorkspaceRecommendations.success', 'The extension was successfully added to this workspace\'s recommendations.'),
[{
......@@ -2321,7 +2321,7 @@ export class AddToWorkspaceRecommendationsAction extends AbstractConfigureRecomm
return Promise.resolve();
}
return this.addExtensionToWorkspaceConfig(workspaceConfig, extensionId, shouldRecommend).then(() => {
return this.addExtensionToWorkspaceConfig(workspaceConfig, extensionId.id, shouldRecommend).then(() => {
this.notificationService.prompt(Severity.Info,
localize('AddToWorkspaceUnwantedRecommendations.success', 'The extension was successfully added to this workspace\'s unwanted recommendations.'),
[{
......@@ -2387,12 +2387,12 @@ export class DisabledStatusLabelAction extends Action {
}
private update(extension?: IExtension): void {
if (extension && this.extension && !areSameExtensions(this.extension, extension)) {
if (extension && this.extension && !areSameExtensions(this.extension.identifier, extension.identifier)) {
return;
}
this.class = `${DisabledStatusLabelAction.Class} hide`;
this.tooltip = '';
if (this.extension && this.extension.local && !this.extension.isMalicious && !this.runningExtensions.some(e => e.id === this.extension.id)) {
if (this.extension && this.extension.local && !this.extension.isMalicious && !this.runningExtensions.some(e => areSameExtensions(e, this.extension.identifier))) {
if (this.extensionManagementServerService.remoteExtensionManagementServer && !isUIExtension(this.extension.local.manifest, this.configurationService) && this.extension.locals) {
const installedInRemoteServer = this.extension.locals.some(local => {
const server = this.extensionManagementServerService.getExtensionManagementServer(local.location);
......@@ -2643,9 +2643,9 @@ export class ReinstallAction extends Action {
.filter(extension => extension.type === LocalExtensionType.User)
.map(extension => {
return {
id: extension.id,
id: extension.identifier.id,
label: extension.displayName,
description: extension.id,
description: extension.identifier.id,
extension,
} as (IQuickPickItem & { extension: IExtension });
});
......@@ -2725,9 +2725,9 @@ export class InstallSpecificVersionOfExtensionAction extends Action {
.sort((e1, e2) => e1.extension.displayName.localeCompare(e2.extension.displayName))
.map(({ extension, versions }) => {
return {
id: extension.id,
label: extension.displayName || extension.id,
description: extension.id,
id: extension.identifier.id,
label: extension.displayName || extension.identifier.id,
description: extension.identifier.id,
extension,
versions
} as (IQuickPickItem & { extension: IExtension, versions: IGalleryExtensionVersion[] });
......
......@@ -20,6 +20,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { RuntimeExtensionsInput } from 'vs/workbench/services/extensions/electron-browser/runtimeExtensionsInput';
import { generateUuid } from 'vs/base/common/uuid';
import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions';
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchContribution {
......@@ -162,7 +163,7 @@ export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchCont
// prompt: only when you can file an issue
const reportAction = new ReportExtensionIssueAction({
marketplaceInfo: this._anotherExtensionService.local.filter(value => value.id === extension.id)[0],
marketplaceInfo: this._anotherExtensionService.local.filter(value => areSameExtensions(value.identifier, extension))[0],
description: extension,
unresponsiveProfile: profile,
status: undefined,
......
......@@ -146,13 +146,13 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
removeClass(data.element, 'loading');
data.extensionDisposables = dispose(data.extensionDisposables);
const installed = this.extensionsWorkbenchService.local.filter(e => e.id === extension.id)[0];
const installed = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, extension.identifier))[0];
this.extensionService.getExtensions().then(runningExtensions => {
if (installed && installed.local) {
const installedExtensionServer = this.extensionManagementServerService.getExtensionManagementServer(installed.local.location);
const isSameExtensionRunning = runningExtensions.some(e => {
if (!areSameExtensions(e, extension)) {
if (!areSameExtensions(e, extension.identifier)) {
return false;
}
const runningExtensionServer = this.extensionManagementServerService.getExtensionManagementServer(e.extensionLocation);
......@@ -180,7 +180,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
this.updateRecommendationStatus(extension, data);
data.extensionDisposables.push(this.extensionTipsService.onRecommendationChange(change => {
if (change.extensionId.toLowerCase() === extension.id.toLowerCase()) {
if (areSameExtensions({ id: change.extensionId }, extension.identifier)) {
this.updateRecommendationStatus(extension, data);
}
}));
......@@ -197,13 +197,13 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
}
this.extensionViewState.onFocus(e => {
if (areSameExtensions(extension, e)) {
if (areSameExtensions(extension.identifier, e.identifier)) {
data.actionbar.items.forEach(item => (<ExtensionActionItem>item).setFocus(true));
}
}, this, data.extensionDisposables);
this.extensionViewState.onBlur(e => {
if (areSameExtensions(extension, e)) {
if (areSameExtensions(extension.identifier, e.identifier)) {
data.actionbar.items.forEach(item => (<ExtensionActionItem>item).setFocus(false));
}
}, this, data.extensionDisposables);
......@@ -213,13 +213,13 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
const extRecommendations = this.extensionTipsService.getAllRecommendationsWithReason();
let ariaLabel = extension.displayName + '. ';
if (!extRecommendations[extension.id.toLowerCase()]) {
if (!extRecommendations[extension.identifier.id.toLowerCase()]) {
removeClass(data.root, 'recommended');
data.root.title = '';
} else {
addClass(data.root, 'recommended');
ariaLabel += extRecommendations[extension.id.toLowerCase()].reasonText + ' ';
data.root.title = extRecommendations[extension.id.toLowerCase()].reasonText;
ariaLabel += extRecommendations[extension.identifier.id.toLowerCase()].reasonText + ' ';
data.root.title = extRecommendations[extension.identifier.id.toLowerCase()].reasonText;
}
ariaLabel += localize('viewExtensionDetailsAria', "Press enter for extension details.");
......
......@@ -293,7 +293,7 @@ export class ExtensionsListView extends ViewletPanel {
const result = local
.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName))
.filter(e => runningExtensions.every(r => !areSameExtensions(r, e))
.filter(e => runningExtensions.every(r => !areSameExtensions(r, e.identifier))
&& (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1)
&& (!categories.length || categories.some(category => (e.local.manifest.categories || []).some(c => c.toLowerCase() === category))));
......@@ -308,7 +308,7 @@ export class ExtensionsListView extends ViewletPanel {
const result = local
.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName))
.filter(e => runningExtensions.some(r => areSameExtensions(r, e))
.filter(e => runningExtensions.some(r => areSameExtensions(r, e.identifier))
&& (e.name.toLowerCase().indexOf(value) > -1 || e.displayName.toLowerCase().indexOf(value) > -1)
&& (!categories.length || categories.some(category => (e.local.manifest.categories || []).some(c => c.toLowerCase() === category))));
......@@ -399,7 +399,7 @@ export class ExtensionsListView extends ViewletPanel {
let positionToUpdate = 0;
for (let i = 0; i < preferredResults.length; i++) {
for (let j = positionToUpdate; j < pager.firstPage.length; j++) {
if (pager.firstPage[j].id === preferredResults[i]) {
if (areSameExtensions(pager.firstPage[j].identifier, { id: preferredResults[i] })) {
if (positionToUpdate !== j) {
const preferredExtension = pager.firstPage.splice(j, 1)[0];
pager.firstPage.splice(positionToUpdate, 0, preferredExtension);
......@@ -573,7 +573,7 @@ export class ExtensionsListView extends ViewletPanel {
}
private isRecommendationInstalled(recommendation: IExtensionRecommendation, installed: IExtension[]): boolean {
return installed.some(i => areSameExtensions({ id: i.id }, { id: recommendation.extensionId }));
return installed.some(i => areSameExtensions(i.identifier, { id: recommendation.extensionId }));
}
private getWorkspaceRecommendationsModel(query: Query, options: IQueryOptions): Promise<IPagedModel<IExtension>> {
......@@ -614,7 +614,7 @@ export class ExtensionsListView extends ViewletPanel {
private sortFirstPage(pager: IPager<IExtension>, ids: string[]) {
ids = ids.map(x => x.toLowerCase());
pager.firstPage.sort((a, b) => {
return ids.indexOf(a.id.toLowerCase()) < ids.indexOf(b.id.toLowerCase()) ? -1 : 1;
return ids.indexOf(a.identifier.id.toLowerCase()) < ids.indexOf(b.identifier.id.toLowerCase()) ? -1 : 1;
});
}
......@@ -869,6 +869,6 @@ export class WorkspaceRecommendedExtensionsView extends ExtensionsListView {
private getRecommendationsToInstall(): Promise<IExtensionRecommendation[]> {
return this.tipsService.getWorkspaceRecommendations()
.then(recommendations => recommendations.filter(({ extensionId }) => !this.extensionsWorkbenchService.local.some(i => areSameExtensions({ id: extensionId }, { id: i.id }))));
.then(recommendations => recommendations.filter(({ extensionId }) => !this.extensionsWorkbenchService.local.some(i => areSameExtensions({ id: extensionId }, i.identifier))));
}
}
......@@ -163,7 +163,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
private _resolveExtensions(): IRuntimeExtension[] {
let marketplaceMap: { [id: string]: IExtension; } = Object.create(null);
for (let extension of this._extensionsWorkbenchService.local) {
marketplaceMap[extension.id] = extension;
marketplaceMap[extension.identifier.id] = extension;
}
let statusMap = this._extensionService.getExtensionsStatus();
......
......@@ -72,11 +72,11 @@ class Extension implements IExtension {
return this.local.manifest.displayName || this.local.manifest.name;
}
get id(): string {
get identifier(): IExtensionIdentifier {
if (this.gallery) {
return this.gallery.identifier.id;
return this.gallery.identifier;
}
return getGalleryExtensionIdFromLocal(this.local);
return { id: getGalleryExtensionIdFromLocal(this.local), uuid: this.local.identifier.uuid };
}
get uuid(): string | undefined {
......@@ -209,7 +209,7 @@ class Extension implements IExtension {
if (this.gallery.assets.manifest) {
return this.galleryService.getManifest(this.gallery, token);
}
this.logService.error(nls.localize('Manifest is not found', "Manifest is not found"), this.id);
this.logService.error(nls.localize('Manifest is not found', "Manifest is not found"), this.identifier.id);
return Promise.resolve(null);
}
......@@ -427,7 +427,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
get local(): IExtension[] {
const installing = this.installing
.filter(e => !this.installed.some(installed => installed.id === e.id))
.filter(e => !this.installed.some(installed => areSameExtensions(installed.identifier, e.identifier)))
.map(e => e);
return [...this.installed, ...installing];
......@@ -485,9 +485,9 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
const extensions: IExtension[] = [...this.local, ...galleryExtensions.map(galleryExtension => this.fromGallery(galleryExtension, maliciousSet))];
const map = new Map<string, IExtension>();
for (const extension of extensions) {
map.set(extension.id, extension);
map.set(extension.identifier.id, extension);
}
return new ExtensionDependencies(extension, extension.id, map);
return new ExtensionDependencies(extension, extension.identifier.id, map);
});
});
}
......@@ -564,7 +564,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
result = new Extension(this.galleryService, this.stateProvider, [], gallery, this.telemetryService, this.logService);
}
if (maliciousExtensionSet.has(result.id)) {
if (maliciousExtensionSet.has(result.identifier.id)) {
result.isMalicious = true;
}
......@@ -578,7 +578,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
return installed;
}
} else {
if (installed.id === gallery.identifier.id) { // Installed from other sources
if (areSameExtensions(installed.identifier, gallery.identifier)) { // Installed from other sources
return installed;
}
}
......@@ -625,7 +625,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
if (installed.uuid) {
ids.push(installed.uuid);
} else {
names.push(installed.id);
names.push(installed.identifier.id);
}
}
}
......@@ -706,13 +706,13 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
}
const ext = extension as Extension;
const toUninstall: ILocalExtension[] = ext.locals.length ? ext.locals : this.installed.filter(e => e.id === extension.id)[0].locals;
const toUninstall: ILocalExtension[] = ext.locals.length ? ext.locals : this.installed.filter(e => areSameExtensions(e.identifier, extension.identifier))[0].locals;
if (!toUninstall.length) {
if (!toUninstall || !toUninstall.length) {
return Promise.reject(new Error('Missing local'));
}
this.logService.info(`Requested uninstalling the extension ${extension.id} from window ${this.windowService.getCurrentWindowId()}`);
this.logService.info(`Requested uninstalling the extension ${extension.identifier.id} from window ${this.windowService.getCurrentWindowId()}`);
return this.progressService.withProgress({
location: ProgressLocation.Extensions,
title: nls.localize('uninstallingExtension', 'Uninstalling extension....'),
......@@ -751,9 +751,9 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
}
const ext = extension as Extension;
const toReinstall: ILocalExtension[] = ext.locals.length ? ext.locals : this.installed.filter(e => e.id === extension.id)[0].locals;
const toReinstall: ILocalExtension[] = ext.locals.length ? ext.locals : this.installed.filter(e => areSameExtensions(e.identifier, extension.identifier))[0].locals;
if (!toReinstall.length) {
if (!toReinstall || !toReinstall.length) {
return Promise.reject(new Error('Missing local'));
}
......@@ -827,8 +827,8 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
return (enable || i.type === LocalExtensionType.User) // Include all Extensions for enablement and only user extensions for disablement
&& (options.dependencies || options.pack)
&& extensions.some(extension =>
(options.dependencies && extension.dependencies.some(id => areSameExtensions({ id }, i)))
|| (options.pack && extension.extensionPack.some(id => areSameExtensions({ id }, i)))
(options.dependencies && extension.dependencies.some(id => areSameExtensions({ id }, i.identifier)))
|| (options.pack && extension.extensionPack.some(id => areSameExtensions({ id }, i.identifier)))
);
});
if (extensionsToDisable.length) {
......@@ -853,13 +853,13 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
if (extensionsToDisable.indexOf(i) !== -1) {
return false;
}
return i.dependencies.some(dep => [extension, ...extensionsToDisable].some(d => d.id === dep));
return i.dependencies.some(dep => [extension, ...extensionsToDisable].some(d => areSameExtensions(d.identifier, { id: dep })));
});
}
private getDependentsErrorMessage(extension: IExtension, allDisabledExtensions: IExtension[], dependents: IExtension[]): string {
for (const e of [extension, ...allDisabledExtensions]) {
let dependentsOfTheExtension = dependents.filter(d => d.dependencies.some(id => areSameExtensions({ id }, e)));
let dependentsOfTheExtension = dependents.filter(d => d.dependencies.some(id => areSameExtensions({ id }, e.identifier)));
if (dependentsOfTheExtension.length) {
return this.getErrorMessageForDisablingAnExtensionWithDependents(e, dependentsOfTheExtension);
}
......@@ -917,7 +917,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
return;
}
let extension = this.installed.filter(e => areSameExtensions(e, gallery.identifier))[0];
let extension = this.installed.filter(e => areSameExtensions(e.identifier, gallery.identifier))[0];
if (!extension) {
extension = new Extension(this.galleryService, this.stateProvider, [], gallery, this.telemetryService, this.logService);
......@@ -930,12 +930,12 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
private onDidInstallExtension(event: DidInstallExtensionEvent): void {
const { local, zipPath, error, gallery } = event;
const installingExtension = gallery ? this.installing.filter(e => areSameExtensions(e, gallery.identifier))[0] : null;
const installingExtension = gallery ? this.installing.filter(e => areSameExtensions(e.identifier, gallery.identifier))[0] : null;
let extension: Extension | undefined = installingExtension ? installingExtension : zipPath ? new Extension(this.galleryService, this.stateProvider, local ? [local] : [], void 0, this.telemetryService, this.logService) : undefined;
if (extension) {
this.installing = installingExtension ? this.installing.filter(e => e !== installingExtension) : this.installing;
if (local) {
const installed = this.installed.filter(e => e.id === extension!.id)[0];
const installed = this.installed.filter(e => areSameExtensions(e.identifier, extension!.identifier))[0];
if (installed) {
extension = installed;
const newServer = this.extensionManagementServerService.getExtensionManagementServer(local.location);
......@@ -990,7 +990,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
}
private onEnablementChanged(identifier: IExtensionIdentifier) {
const [extension] = this.local.filter(e => areSameExtensions(e, identifier));
const [extension] = this.local.filter(e => areSameExtensions(e.identifier, identifier));
if (extension && extension.local) {
const enablementState = this.extensionEnablementService.getEnablementState(extension.local);
if (enablementState !== extension.enablementState) {
......@@ -1005,7 +1005,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
return ExtensionState.Installing;
}
if (this.uninstalling.some(e => e.id === extension.id)) {
if (this.uninstalling.some(e => areSameExtensions(e.identifier, extension.identifier))) {
return ExtensionState.Uninstalling;
}
......@@ -1046,7 +1046,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
const extensionId = match[1];
this.queryLocal().then(local => {
const extension = local.filter(local => areSameExtensions({ id: local.id }, { id: extensionId }))[0];
const extension = local.filter(local => areSameExtensions(local.identifier, { id: extensionId }))[0];
if (extension) {
return this.windowService.show()
......
......@@ -327,7 +327,7 @@ suite('ExtensionsListView Tests', () => {
assert.equal(result.length, workspaceRecommendedExtensions.length);
for (let i = 0; i < workspaceRecommendedExtensions.length; i++) {
assert.equal(options.names[i], workspaceRecommendedExtensions[i].identifier.id);
assert.equal(result.get(i).id, workspaceRecommendedExtensions[i].identifier.id);
assert.equal(result.get(i).identifier.id, workspaceRecommendedExtensions[i].identifier.id);
}
});
});
......@@ -348,7 +348,7 @@ suite('ExtensionsListView Tests', () => {
assert.equal(result.length, allRecommendedExtensions.length);
for (let i = 0; i < allRecommendedExtensions.length; i++) {
assert.equal(options.names[i], allRecommendedExtensions[i].identifier.id);
assert.equal(result.get(i).id, allRecommendedExtensions[i].identifier.id);
assert.equal(result.get(i).identifier.id, allRecommendedExtensions[i].identifier.id);
}
});
});
......@@ -372,7 +372,7 @@ suite('ExtensionsListView Tests', () => {
assert.equal(result.length, allRecommendedExtensions.length);
for (let i = 0; i < allRecommendedExtensions.length; i++) {
assert.equal(options.names[i], allRecommendedExtensions[i].identifier.id);
assert.equal(result.get(i).id, allRecommendedExtensions[i].identifier.id);
assert.equal(result.get(i).identifier.id, allRecommendedExtensions[i].identifier.id);
}
});
});
......@@ -395,7 +395,7 @@ suite('ExtensionsListView Tests', () => {
assert.equal(result.length, curatedList.length);
for (let i = 0; i < curatedList.length; i++) {
assert.equal(options.names[i], curatedList[i].identifier.id);
assert.equal(result.get(i).id, curatedList[i].identifier.id);
assert.equal(result.get(i).identifier.id, curatedList[i].identifier.id);
}
assert.equal(curatedKey, 'mykey');
});
......@@ -417,7 +417,7 @@ suite('ExtensionsListView Tests', () => {
assert.equal(options.text, searchText);
assert.equal(result.length, results.length);
for (let i = 0; i < results.length; i++) {
assert.equal(result.get(i).id, results[i].identifier.id);
assert.equal(result.get(i).identifier.id, results[i].identifier.id);
}
});
});
......@@ -466,7 +466,7 @@ suite('ExtensionsListView Tests', () => {
assert.equal(options.text, searchText);
assert.equal(result.length, expected.length);
for (let i = 0; i < expected.length; i++) {
assert.equal(result.get(i).id, expected[i].identifier.id);
assert.equal(result.get(i).identifier.id, expected[i].identifier.id);
}
});
});
......@@ -492,7 +492,7 @@ suite('ExtensionsListView Tests', () => {
assert.equal(options.text, searchText);
assert.equal(result.length, realResults.length);
for (let i = 0; i < realResults.length; i++) {
assert.equal(result.get(i).id, realResults[i].identifier.id);
assert.equal(result.get(i).identifier.id, realResults[i].identifier.id);
}
});
});
......
......@@ -131,7 +131,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
assert.equal(null, actual.type);
assert.equal('expectedName', actual.name);
assert.equal('expectedDisplayName', actual.displayName);
assert.equal('expectedpublisher.expectedname', actual.id);
assert.equal('expectedpublisher.expectedname', actual.identifier.id);
assert.equal('expectedPublisher', actual.publisher);
assert.equal('expectedPublisherDisplayName', actual.publisherDisplayName);
assert.equal('1.5', actual.version);
......@@ -189,7 +189,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
assert.equal(LocalExtensionType.User, actual.type);
assert.equal('local1', actual.name);
assert.equal('localDisplayName1', actual.displayName);
assert.equal('localpublisher1.local1', actual.id);
assert.equal('localpublisher1.local1', actual.identifier.id);
assert.equal('localPublisher1', actual.publisher);
assert.equal('1.1.0', actual.version);
assert.equal('1.1.0', actual.latestVersion);
......@@ -208,7 +208,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
assert.equal(LocalExtensionType.System, actual.type);
assert.equal('local2', actual.name);
assert.equal('localDisplayName2', actual.displayName);
assert.equal('localpublisher2.local2', actual.id);
assert.equal('localpublisher2.local2', actual.identifier.id);
assert.equal('localPublisher2', actual.publisher);
assert.equal('1.2.0', actual.version);
assert.equal('1.2.0', actual.latestVersion);
......@@ -283,7 +283,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
assert.equal(LocalExtensionType.User, actual.type);
assert.equal('local1', actual.name);
assert.equal('expectedDisplayName', actual.displayName);
assert.equal('localpublisher1.local1', actual.id);
assert.equal('localpublisher1.local1', actual.identifier.id);
assert.equal('localPublisher1', actual.publisher);
assert.equal('1.1.0', actual.version);
assert.equal('1.5.0', actual.latestVersion);
......@@ -302,7 +302,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
assert.equal(LocalExtensionType.System, actual.type);
assert.equal('local2', actual.name);
assert.equal('localDisplayName2', actual.displayName);
assert.equal('localpublisher2.local2', actual.id);
assert.equal('localpublisher2.local2', actual.identifier.id);
assert.equal('localPublisher2', actual.publisher);
assert.equal('1.2.0', actual.version);
assert.equal('1.2.0', actual.latestVersion);
......@@ -335,7 +335,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
let local = testObject.local;
assert.equal(1, local.length);
const actual = local[0];
assert.equal(`${gallery.publisher}.${gallery.name}`, actual.id);
assert.equal(`${gallery.publisher}.${gallery.name}`, actual.identifier.id);
assert.equal(ExtensionState.Installing, actual.state);
// Installed
......@@ -497,21 +497,21 @@ suite('ExtensionsWorkbenchServiceTest', () => {
actual = dependent.dependencies[0];
assert.ok(!actual.hasDependencies);
assert.equal('pub.b', actual.extension.id);
assert.equal('pub.b', actual.extension.identifier.id);
assert.equal('pub.b', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
actual = dependent.dependencies[1];
assert.ok(!actual.hasDependencies);
assert.equal('pub.c', actual.extension.id);
assert.equal('pub.c', actual.extension.identifier.id);
assert.equal('pub.c', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
actual = dependent.dependencies[2];
assert.ok(!actual.hasDependencies);
assert.equal('pub.d', actual.extension.id);
assert.equal('pub.d', actual.extension.identifier.id);
assert.equal('pub.d', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
......@@ -536,14 +536,14 @@ suite('ExtensionsWorkbenchServiceTest', () => {
actual = dependent.dependencies[0];
assert.ok(!actual.hasDependencies);
assert.equal('pub.b', actual.extension.id);
assert.equal('pub.b', actual.extension.identifier.id);
assert.equal('pub.b', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
actual = dependent.dependencies[1];
assert.ok(!actual.hasDependencies);
assert.equal('pub.a', actual.extension.id);
assert.equal('pub.a', actual.extension.identifier.id);
assert.equal('pub.a', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
......@@ -575,7 +575,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
actual = dependent.dependencies[1];
assert.ok(!actual.hasDependencies);
assert.equal('pub.a', actual.extension.id);
assert.equal('pub.a', actual.extension.identifier.id);
assert.equal('pub.a', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
......@@ -602,7 +602,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
actual = dependent.dependencies[0];
assert.ok(!actual.hasDependencies);
assert.equal('pub.inbuilt', actual.extension.id);
assert.equal('pub.inbuilt', actual.extension.identifier.id);
assert.equal('pub.inbuilt', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
......@@ -610,7 +610,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
actual = dependent.dependencies[1];
assert.ok(!actual.hasDependencies);
assert.equal('pub.a', actual.extension.id);
assert.equal('pub.a', actual.extension.identifier.id);
assert.equal('pub.a', actual.identifier);
assert.equal(dependent, actual.dependent);
assert.equal(0, actual.dependencies.length);
......@@ -639,28 +639,28 @@ suite('ExtensionsWorkbenchServiceTest', () => {
let b = a.dependencies[0];
assert.ok(b.hasDependencies);
assert.equal('pub.b', b.extension.id);
assert.equal('pub.b', b.extension.identifier.id);
assert.equal('pub.b', b.identifier);
assert.equal(a, b.dependent);
assert.equal(2, b.dependencies.length);
let c = a.dependencies[1];
assert.ok(c.hasDependencies);
assert.equal('pub.c', c.extension.id);
assert.equal('pub.c', c.extension.identifier.id);
assert.equal('pub.c', c.identifier);
assert.equal(a, c.dependent);
assert.equal(1, c.dependencies.length);
let d = b.dependencies[0];
assert.ok(d.hasDependencies);
assert.equal('pub.d', d.extension.id);
assert.equal('pub.d', d.extension.identifier.id);
assert.equal('pub.d', d.identifier);
assert.equal(b, d.dependent);
assert.equal(2, d.dependencies.length);
let e = b.dependencies[1];
assert.ok(!e.hasDependencies);
assert.equal('pub.e', e.extension.id);
assert.equal('pub.e', e.extension.identifier.id);
assert.equal('pub.e', e.identifier);
assert.equal(b, e.dependent);
assert.equal(0, e.dependencies.length);
......@@ -674,14 +674,14 @@ suite('ExtensionsWorkbenchServiceTest', () => {
c = d.dependencies[1];
assert.ok(c.hasDependencies);
assert.equal('pub.c', c.extension.id);
assert.equal('pub.c', c.extension.identifier.id);
assert.equal('pub.c', c.identifier);
assert.equal(d, c.dependent);
assert.equal(1, c.dependencies.length);
d = c.dependencies[0];
assert.ok(!d.hasDependencies);
assert.equal('pub.d', d.extension.id);
assert.equal('pub.d', d.extension.identifier.id);
assert.equal('pub.d', d.identifier);
assert.equal(c, d.dependent);
assert.equal(0, d.dependencies.length);
......@@ -689,7 +689,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
c = a.dependencies[1];
d = c.dependencies[0];
assert.ok(d.hasDependencies);
assert.equal('pub.d', d.extension.id);
assert.equal('pub.d', d.extension.identifier.id);
assert.equal('pub.d', d.identifier);
assert.equal(c, d.dependent);
assert.equal(2, d.dependencies.length);
......@@ -703,7 +703,7 @@ suite('ExtensionsWorkbenchServiceTest', () => {
c = d.dependencies[1];
assert.ok(!c.hasDependencies);
assert.equal('pub.c', c.extension.id);
assert.equal('pub.c', c.extension.identifier.id);
assert.equal('pub.c', c.identifier);
assert.equal(d, c.dependent);
assert.equal(0, c.dependencies.length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册