-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d53102f
commit 956cbd4
Showing
6 changed files
with
63 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/vs/workbench/contrib/extensions/electron-sandbox/installFailedExtensions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { CancellationToken } from '../../../../base/common/cancellation.js'; | ||
import { Disposable } from '../../../../base/common/lifecycle.js'; | ||
import { IExtensionGalleryService, IExtensionManagementService } from '../../../../platform/extensionManagement/common/extensionManagement.js'; | ||
import { ILogService } from '../../../../platform/log/common/log.js'; | ||
import { IRemoteExtensionsScannerService } from '../../../../platform/remote/common/remoteExtensionsScanner.js'; | ||
import { IWorkbenchContribution } from '../../../common/contributions.js'; | ||
|
||
export class InstallFailedExtensions extends Disposable implements IWorkbenchContribution { | ||
constructor( | ||
@IRemoteExtensionsScannerService remoteExtensionsScannerService: IRemoteExtensionsScannerService, | ||
@IExtensionGalleryService private readonly _extensionGalleryService: IExtensionGalleryService, | ||
@IExtensionManagementService private readonly _extensionManagementService: IExtensionManagementService, | ||
@ILogService logService: ILogService | ||
) { | ||
super(); | ||
|
||
remoteExtensionsScannerService.whenExtensionsReady() | ||
.then(async ({ extensions, installOptions }) => { | ||
logService.debug('Failed from remote', extensions); | ||
|
||
const registryExtensionIds = extensions | ||
.filter(ext => typeof ext === 'string') | ||
.map(ext => ({ id: ext })); | ||
|
||
const exts = await this._extensionGalleryService.getExtensions(registryExtensionIds, CancellationToken.None); | ||
for (const ext of exts) { | ||
await this._extensionManagementService.installFromGallery(ext, installOptions); | ||
} | ||
|
||
}).catch(e => { | ||
logService.error('Failed in InstallFailedExtensions', e); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters