Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/code/electron-utility/sharedProcess/contrib/extensions.ts
5221 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Disposable } from '../../../../base/common/lifecycle.js';
7
import { IExtensionGalleryService, IGlobalExtensionEnablementService } from '../../../../platform/extensionManagement/common/extensionManagement.js';
8
import { ExtensionStorageService, IExtensionStorageService } from '../../../../platform/extensionManagement/common/extensionStorage.js';
9
import { migrateUnsupportedExtensions } from '../../../../platform/extensionManagement/common/unsupportedExtensionsMigration.js';
10
import { INativeServerExtensionManagementService } from '../../../../platform/extensionManagement/node/extensionManagementService.js';
11
import { ILogService } from '../../../../platform/log/common/log.js';
12
import { IStorageService } from '../../../../platform/storage/common/storage.js';
13
import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js';
14
15
export class ExtensionsContributions extends Disposable {
16
constructor(
17
@INativeServerExtensionManagementService private readonly extensionManagementService: INativeServerExtensionManagementService,
18
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,
19
@IExtensionStorageService private readonly extensionStorageService: IExtensionStorageService,
20
@IGlobalExtensionEnablementService private readonly extensionEnablementService: IGlobalExtensionEnablementService,
21
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
22
@IStorageService storageService: IStorageService,
23
@ILogService private readonly logService: ILogService,
24
) {
25
super();
26
27
extensionManagementService.cleanUp();
28
29
this.migrateUnsupportedExtensions();
30
ExtensionStorageService.removeOutdatedExtensionVersions(extensionManagementService, storageService);
31
}
32
33
private async migrateUnsupportedExtensions(): Promise<void> {
34
for (const profile of this.userDataProfilesService.profiles) {
35
await migrateUnsupportedExtensions(profile, this.extensionManagementService, this.extensionGalleryService, this.extensionStorageService, this.extensionEnablementService, this.logService);
36
}
37
}
38
39
}
40
41