Path: blob/main/src/vs/code/electron-utility/sharedProcess/contrib/extensions.ts
5221 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Disposable } from '../../../../base/common/lifecycle.js';6import { IExtensionGalleryService, IGlobalExtensionEnablementService } from '../../../../platform/extensionManagement/common/extensionManagement.js';7import { ExtensionStorageService, IExtensionStorageService } from '../../../../platform/extensionManagement/common/extensionStorage.js';8import { migrateUnsupportedExtensions } from '../../../../platform/extensionManagement/common/unsupportedExtensionsMigration.js';9import { INativeServerExtensionManagementService } from '../../../../platform/extensionManagement/node/extensionManagementService.js';10import { ILogService } from '../../../../platform/log/common/log.js';11import { IStorageService } from '../../../../platform/storage/common/storage.js';12import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js';1314export class ExtensionsContributions extends Disposable {15constructor(16@INativeServerExtensionManagementService private readonly extensionManagementService: INativeServerExtensionManagementService,17@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,18@IExtensionStorageService private readonly extensionStorageService: IExtensionStorageService,19@IGlobalExtensionEnablementService private readonly extensionEnablementService: IGlobalExtensionEnablementService,20@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,21@IStorageService storageService: IStorageService,22@ILogService private readonly logService: ILogService,23) {24super();2526extensionManagementService.cleanUp();2728this.migrateUnsupportedExtensions();29ExtensionStorageService.removeOutdatedExtensionVersions(extensionManagementService, storageService);30}3132private async migrateUnsupportedExtensions(): Promise<void> {33for (const profile of this.userDataProfilesService.profiles) {34await migrateUnsupportedExtensions(profile, this.extensionManagementService, this.extensionGalleryService, this.extensionStorageService, this.extensionEnablementService, this.logService);35}36}3738}394041