@codingame/monaco-vscode-extension-gallery-service-override 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensionGallery.js +2 -0
- package/package.json +2 -2
- package/tools.js +42 -0
- package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js +101 -96
- package/vscode/src/vs/platform/extensionManagement/common/extensionGalleryService.js +9 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementIpc.js +9 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +23 -35
- package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +3 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/deprecatedExtensionsChecker.js +5 -7
- package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +3 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +43 -46
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +2 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +23 -27
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +19 -29
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +213 -284
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.web.contribution.js +2 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +2 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +2 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +7 -9
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsList.js +3 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +5 -6
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +4 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +40 -49
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +15 -27
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +40 -43
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +431 -269
- package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +4 -6
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extension.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +3 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +4 -12
- package/vscode/src/vs/workbench/contrib/extensions/common/reportExtensionIssueAction.js +2 -3
- package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +3 -4
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.js +20 -29
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +4 -6
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.js +6 -8
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementChannelClient.js +7 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.js +3 -4
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.js +84 -90
- package/vscode/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.js +0 -1
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +12 -19
package/extensionGallery.js
CHANGED
|
@@ -42,6 +42,7 @@ import { getExtensionManifests } from 'vscode/extensions';
|
|
|
42
42
|
import { isLocaleAvailable } from 'vscode/l10n';
|
|
43
43
|
import './vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js';
|
|
44
44
|
import './vscode/src/vs/workbench/contrib/extensions/browser/extensions.web.contribution.js';
|
|
45
|
+
import { unsupported } from './tools.js';
|
|
45
46
|
|
|
46
47
|
registerAssets({
|
|
47
48
|
'vs/workbench/services/extensionManagement/common/media/defaultIcon.png': ( new URL('./assets/defaultIcon.png', import.meta.url).toString()),
|
|
@@ -50,6 +51,7 @@ registerAssets({
|
|
|
50
51
|
});
|
|
51
52
|
class EmptyRemoteAgentService {
|
|
52
53
|
constructor() {
|
|
54
|
+
this.endConnection = unsupported;
|
|
53
55
|
this.getConnection = () => null;
|
|
54
56
|
this.getEnvironment = async () => null;
|
|
55
57
|
this.getRawEnvironment = async () => null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extension-gallery-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@8.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/tools.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function unsupported() {
|
|
2
|
+
throw new Error('unsupported');
|
|
3
|
+
}
|
|
4
|
+
function memoized(fct) {
|
|
5
|
+
let v = null;
|
|
6
|
+
return (...args) => {
|
|
7
|
+
if (v == null) {
|
|
8
|
+
v = fct(...args);
|
|
9
|
+
}
|
|
10
|
+
return v;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function memoizedConstructor(ctor) {
|
|
14
|
+
return new Proxy(ctor, {
|
|
15
|
+
construct: memoized((target, args) => {
|
|
16
|
+
return Reflect.construct(ctor, args);
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
async function sleep(duration) {
|
|
21
|
+
await new Promise(resolve => setTimeout(resolve, duration));
|
|
22
|
+
}
|
|
23
|
+
function throttle(fct, merge, delay) {
|
|
24
|
+
let lastPromise = Promise.resolve();
|
|
25
|
+
let toConsume = null;
|
|
26
|
+
return async (param) => {
|
|
27
|
+
if (toConsume == null) {
|
|
28
|
+
toConsume = param;
|
|
29
|
+
lastPromise = lastPromise.then(async () => sleep(delay)).then(async () => {
|
|
30
|
+
const _toConsume = toConsume;
|
|
31
|
+
toConsume = null;
|
|
32
|
+
await fct(_toConsume);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
toConsume = merge(toConsume, param);
|
|
37
|
+
}
|
|
38
|
+
await lastPromise;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { memoized, memoizedConstructor, sleep, throttle, unsupported };
|
package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js
CHANGED
|
@@ -5,10 +5,11 @@ import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
|
5
5
|
import { getErrorMessage, isCancellationError, CancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
6
6
|
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
7
7
|
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
8
9
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
9
10
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
10
11
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
11
|
-
import {
|
|
12
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
12
13
|
import { isTargetPlatformCompatible, ExtensionManagementError, ExtensionManagementErrorCode, InstallOperation, EXTENSION_INSTALL_DEP_PACK_CONTEXT, EXTENSION_INSTALL_SOURCE_CONTEXT, StatisticType, TargetPlatformToString, ExtensionGalleryError, ExtensionGalleryErrorCode } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
13
14
|
import { IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
14
15
|
import { areSameExtensions, ExtensionKey, getGalleryExtensionId, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
@@ -20,7 +21,6 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
20
21
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
21
22
|
import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
22
23
|
|
|
23
|
-
const _moduleId = "vs/platform/extensionManagement/common/abstractExtensionManagementService";
|
|
24
24
|
let AbstractExtensionManagementService = class AbstractExtensionManagementService extends Disposable {
|
|
25
25
|
get onInstallExtension() { return this._onInstallExtension.event; }
|
|
26
26
|
get onDidInstallExtensions() { return this._onDidInstallExtensions.event; }
|
|
@@ -81,7 +81,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
81
81
|
async installGalleryExtensions(extensions) {
|
|
82
82
|
if (!this.galleryService.isEnabled()) {
|
|
83
83
|
throw ( (new ExtensionManagementError(
|
|
84
|
-
|
|
84
|
+
localize(11109, "Marketplace is not enabled"),
|
|
85
85
|
ExtensionManagementErrorCode.NotAllowed
|
|
86
86
|
)));
|
|
87
87
|
}
|
|
@@ -101,9 +101,9 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
101
101
|
}
|
|
102
102
|
return results;
|
|
103
103
|
}
|
|
104
|
-
async uninstall(extension, options
|
|
104
|
+
async uninstall(extension, options) {
|
|
105
105
|
this.logService.trace('ExtensionManagementService#uninstall', extension.identifier.id);
|
|
106
|
-
return this.
|
|
106
|
+
return this.uninstallExtensions([{ extension, options }]);
|
|
107
107
|
}
|
|
108
108
|
async toggleAppliationScope(extension, fromProfileLocation) {
|
|
109
109
|
if (isApplicationScopedExtension(extension.manifest) || extension.isBuiltin) {
|
|
@@ -145,6 +145,22 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
145
145
|
registerParticipant(participant) {
|
|
146
146
|
this.participants.push(participant);
|
|
147
147
|
}
|
|
148
|
+
async resetPinnedStateForAllUserExtensions(pinned) {
|
|
149
|
+
try {
|
|
150
|
+
await this.joinAllSettled(( (this.userDataProfilesService.profiles.map(async (profile) => {
|
|
151
|
+
const extensions = await this.getInstalled(ExtensionType.User, profile.extensionsResource);
|
|
152
|
+
await this.joinAllSettled(( (extensions.map(async (extension) => {
|
|
153
|
+
if (extension.pinned !== pinned) {
|
|
154
|
+
await this.updateMetadata(extension, { pinned }, profile.extensionsResource);
|
|
155
|
+
}
|
|
156
|
+
}))));
|
|
157
|
+
}))));
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
this.logService.error('Error while resetting pinned state for all user extensions', getErrorMessage(error));
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
148
164
|
async installExtensions(extensions) {
|
|
149
165
|
const installExtensionResultsMap = ( (new Map()));
|
|
150
166
|
const installingExtensionsMap = ( (new Map()));
|
|
@@ -455,9 +471,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
455
471
|
let compatibleExtension;
|
|
456
472
|
const extensionsControlManifest = await this.getExtensionsControlManifest();
|
|
457
473
|
if (( (extensionsControlManifest.malicious.some(identifier => areSameExtensions(extension.identifier, identifier))))) {
|
|
458
|
-
throw ( (new ExtensionManagementError(
|
|
459
|
-
|
|
460
|
-
1,
|
|
474
|
+
throw ( (new ExtensionManagementError(localize(
|
|
475
|
+
11110,
|
|
461
476
|
"Can't install '{0}' extension since it was reported to be problematic.",
|
|
462
477
|
extension.identifier.id
|
|
463
478
|
), ExtensionManagementErrorCode.Malicious)));
|
|
@@ -467,9 +482,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
467
482
|
this.logService.info(`The '${extension.identifier.id}' extension is deprecated, fetching the compatible '${deprecationInfo.extension.id}' extension instead.`);
|
|
468
483
|
compatibleExtension = (await this.galleryService.getExtensions([{ id: deprecationInfo.extension.id, preRelease: deprecationInfo.extension.preRelease }], { targetPlatform: await this.getTargetPlatform(), compatible: true, productVersion }, CancellationToken.None))[0];
|
|
469
484
|
if (!compatibleExtension) {
|
|
470
|
-
throw ( (new ExtensionManagementError(
|
|
471
|
-
|
|
472
|
-
2,
|
|
485
|
+
throw ( (new ExtensionManagementError(localize(
|
|
486
|
+
11111,
|
|
473
487
|
"Can't install '{0}' extension since it was deprecated and the replacement extension '{1}' can't be found.",
|
|
474
488
|
extension.identifier.id,
|
|
475
489
|
deprecationInfo.extension.id
|
|
@@ -479,9 +493,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
479
493
|
else {
|
|
480
494
|
if (!(await this.canInstall(extension))) {
|
|
481
495
|
const targetPlatform = await this.getTargetPlatform();
|
|
482
|
-
throw ( (new ExtensionManagementError(
|
|
483
|
-
|
|
484
|
-
3,
|
|
496
|
+
throw ( (new ExtensionManagementError(localize(
|
|
497
|
+
11112,
|
|
485
498
|
"The '{0}' extension is not available in {1} for {2}.",
|
|
486
499
|
extension.identifier.id,
|
|
487
500
|
this.productService.nameLong,
|
|
@@ -492,25 +505,22 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
492
505
|
if (!compatibleExtension) {
|
|
493
506
|
const incompatibleApiProposalsMessages = [];
|
|
494
507
|
if (!areApiProposalsCompatible(extension.properties.enabledApiProposals ?? [], incompatibleApiProposalsMessages)) {
|
|
495
|
-
throw ( (new ExtensionManagementError(
|
|
496
|
-
|
|
497
|
-
4,
|
|
508
|
+
throw ( (new ExtensionManagementError(localize(
|
|
509
|
+
11113,
|
|
498
510
|
"Can't install '{0}' extension. {1}",
|
|
499
511
|
extension.displayName ?? extension.identifier.id,
|
|
500
512
|
incompatibleApiProposalsMessages[0]
|
|
501
513
|
), ExtensionManagementErrorCode.IncompatibleApi)));
|
|
502
514
|
}
|
|
503
515
|
if (!installPreRelease && extension.properties.isPreReleaseVersion && (await this.galleryService.getExtensions([extension.identifier], CancellationToken.None))[0]) {
|
|
504
|
-
throw ( (new ExtensionManagementError(
|
|
505
|
-
|
|
506
|
-
5,
|
|
516
|
+
throw ( (new ExtensionManagementError(localize(
|
|
517
|
+
11114,
|
|
507
518
|
"Can't install release version of '{0}' extension because it has no release version.",
|
|
508
519
|
extension.displayName ?? extension.identifier.id
|
|
509
520
|
), ExtensionManagementErrorCode.ReleaseVersionNotFound)));
|
|
510
521
|
}
|
|
511
|
-
throw ( (new ExtensionManagementError(
|
|
512
|
-
|
|
513
|
-
6,
|
|
522
|
+
throw ( (new ExtensionManagementError(localize(
|
|
523
|
+
11115,
|
|
514
524
|
"Can't install '{0}' extension because it is not compatible with the current version of {1} (version {2}).",
|
|
515
525
|
extension.identifier.id,
|
|
516
526
|
this.productService.nameLong,
|
|
@@ -553,79 +563,75 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
553
563
|
}
|
|
554
564
|
return compatibleExtension;
|
|
555
565
|
}
|
|
556
|
-
async
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
profileLocation: extension.isApplicationScoped ? this.userDataProfilesService.defaultProfile.extensionsResource : options.profileLocation ?? this.getCurrentExtensionsManifestLocation()
|
|
560
|
-
};
|
|
561
|
-
const getUninstallExtensionTaskKey = (identifier) => `${identifier.id.toLowerCase()}${uninstallOptions.versionOnly ? `-${extension.manifest.version}` : ''}${uninstallOptions.profileLocation ? `@${( (uninstallOptions.profileLocation.toString()))}` : ''}`;
|
|
562
|
-
const uninstallExtensionTask = this.uninstallingExtensions.get(getUninstallExtensionTaskKey(extension.identifier));
|
|
563
|
-
if (uninstallExtensionTask) {
|
|
564
|
-
this.logService.info('Extensions is already requested to uninstall', extension.identifier.id);
|
|
565
|
-
return uninstallExtensionTask.waitUntilTaskIsFinished();
|
|
566
|
-
}
|
|
567
|
-
const createUninstallExtensionTask = (extension) => {
|
|
566
|
+
async uninstallExtensions(extensions) {
|
|
567
|
+
const getUninstallExtensionTaskKey = (extension, uninstallOptions) => `${extension.identifier.id.toLowerCase()}${uninstallOptions.versionOnly ? `-${extension.manifest.version}` : ''}@${( (uninstallOptions.profileLocation.toString()))}`;
|
|
568
|
+
const createUninstallExtensionTask = (extension, uninstallOptions) => {
|
|
568
569
|
const uninstallExtensionTask = this.createUninstallExtensionTask(extension, uninstallOptions);
|
|
569
|
-
this.uninstallingExtensions.set(getUninstallExtensionTaskKey(uninstallExtensionTask.extension
|
|
570
|
-
|
|
571
|
-
this.logService.info('Uninstalling extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())));
|
|
572
|
-
}
|
|
573
|
-
else {
|
|
574
|
-
this.logService.info('Uninstalling extension:', `${extension.identifier.id}@${extension.manifest.version}`);
|
|
575
|
-
}
|
|
570
|
+
this.uninstallingExtensions.set(getUninstallExtensionTaskKey(uninstallExtensionTask.extension, uninstallOptions), uninstallExtensionTask);
|
|
571
|
+
this.logService.info('Uninstalling extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())));
|
|
576
572
|
this._onUninstallExtension.fire({ identifier: extension.identifier, profileLocation: uninstallOptions.profileLocation, applicationScoped: extension.isApplicationScoped });
|
|
577
573
|
return uninstallExtensionTask;
|
|
578
574
|
};
|
|
579
|
-
const postUninstallExtension = (extension, error) => {
|
|
575
|
+
const postUninstallExtension = (extension, uninstallOptions, error) => {
|
|
580
576
|
if (error) {
|
|
581
|
-
|
|
582
|
-
this.logService.error('Failed to uninstall extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())), error.message);
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
this.logService.error('Failed to uninstall extension:', `${extension.identifier.id}@${extension.manifest.version}`, error.message);
|
|
586
|
-
}
|
|
577
|
+
this.logService.error('Failed to uninstall extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())), error.message);
|
|
587
578
|
}
|
|
588
579
|
else {
|
|
589
|
-
|
|
590
|
-
this.logService.info('Successfully uninstalled extension from the profile', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())));
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
this.logService.info('Successfully uninstalled extension:', `${extension.identifier.id}@${extension.manifest.version}`);
|
|
594
|
-
}
|
|
580
|
+
this.logService.info('Successfully uninstalled extension from the profile', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())));
|
|
595
581
|
}
|
|
596
582
|
reportTelemetry(this.telemetryService, 'extensionGallery:uninstall', { extensionData: getLocalExtensionTelemetryData(extension), error });
|
|
597
583
|
this._onDidUninstallExtension.fire({ identifier: extension.identifier, error: error?.code, profileLocation: uninstallOptions.profileLocation, applicationScoped: extension.isApplicationScoped });
|
|
598
584
|
};
|
|
599
585
|
const allTasks = [];
|
|
600
586
|
const processedTasks = [];
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
587
|
+
const alreadyRequestedUninstalls = [];
|
|
588
|
+
const installedExtensionsMap = ( (new ResourceMap()));
|
|
589
|
+
for (const { extension, options } of extensions) {
|
|
590
|
+
const uninstallOptions = {
|
|
591
|
+
...options,
|
|
592
|
+
profileLocation: extension.isApplicationScoped ? this.userDataProfilesService.defaultProfile.extensionsResource : options?.profileLocation ?? this.getCurrentExtensionsManifestLocation()
|
|
593
|
+
};
|
|
594
|
+
const uninstallExtensionTask = this.uninstallingExtensions.get(getUninstallExtensionTaskKey(extension, uninstallOptions));
|
|
595
|
+
if (uninstallExtensionTask) {
|
|
596
|
+
this.logService.info('Extensions is already requested to uninstall', extension.identifier.id);
|
|
597
|
+
alreadyRequestedUninstalls.push(uninstallExtensionTask.waitUntilTaskIsFinished());
|
|
606
598
|
}
|
|
607
599
|
else {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
600
|
+
allTasks.push(createUninstallExtensionTask(extension, uninstallOptions));
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
try {
|
|
604
|
+
for (const task of allTasks.slice(0)) {
|
|
605
|
+
let installed = installedExtensionsMap.get(task.options.profileLocation);
|
|
606
|
+
if (!installed) {
|
|
607
|
+
installedExtensionsMap.set(task.options.profileLocation, installed = await this.getInstalled(ExtensionType.User, task.options.profileLocation));
|
|
608
|
+
}
|
|
609
|
+
if (task.options.donotIncludePack) {
|
|
610
|
+
this.logService.info('Uninstalling the extension without including packed extension', `${task.extension.identifier.id}@${task.extension.manifest.version}`);
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
const packedExtensions = this.getAllPackExtensionsToUninstall(task.extension, installed);
|
|
614
|
+
for (const packedExtension of packedExtensions) {
|
|
615
|
+
if (( (this.uninstallingExtensions.has(getUninstallExtensionTaskKey(packedExtension, task.options))))) {
|
|
616
|
+
this.logService.info('Extensions is already requested to uninstall', packedExtension.identifier.id);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
allTasks.push(createUninstallExtensionTask(packedExtension, task.options));
|
|
620
|
+
}
|
|
615
621
|
}
|
|
616
622
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
+
if (task.options.donotCheckDependents) {
|
|
624
|
+
this.logService.info('Uninstalling the extension without checking dependents', `${task.extension.identifier.id}@${task.extension.manifest.version}`);
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
this.checkForDependents(( (allTasks.map(task => task.extension))), installed, task.extension);
|
|
628
|
+
}
|
|
623
629
|
}
|
|
624
630
|
await this.joinAllSettled(( (allTasks.map(async (task) => {
|
|
625
631
|
try {
|
|
626
632
|
await task.run();
|
|
627
633
|
await this.joinAllSettled(( (this.participants.map(
|
|
628
|
-
participant => participant.postUninstall(task.extension,
|
|
634
|
+
participant => participant.postUninstall(task.extension, task.options, CancellationToken.None)
|
|
629
635
|
))));
|
|
630
636
|
if (task.extension.identifier.uuid) {
|
|
631
637
|
try {
|
|
@@ -633,17 +639,22 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
633
639
|
}
|
|
634
640
|
catch (error) { }
|
|
635
641
|
}
|
|
636
|
-
postUninstallExtension(task.extension);
|
|
637
642
|
}
|
|
638
643
|
catch (e) {
|
|
639
644
|
const error = toExtensionManagementError(e);
|
|
640
|
-
postUninstallExtension(task.extension, error);
|
|
645
|
+
postUninstallExtension(task.extension, task.options, error);
|
|
641
646
|
throw error;
|
|
642
647
|
}
|
|
643
648
|
finally {
|
|
644
649
|
processedTasks.push(task);
|
|
645
650
|
}
|
|
646
651
|
}))));
|
|
652
|
+
if (alreadyRequestedUninstalls.length) {
|
|
653
|
+
await this.joinAllSettled(alreadyRequestedUninstalls);
|
|
654
|
+
}
|
|
655
|
+
for (const task of allTasks) {
|
|
656
|
+
postUninstallExtension(task.extension, task.options);
|
|
657
|
+
}
|
|
647
658
|
}
|
|
648
659
|
catch (e) {
|
|
649
660
|
const error = toExtensionManagementError(e);
|
|
@@ -653,14 +664,14 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
653
664
|
}
|
|
654
665
|
catch (error) { }
|
|
655
666
|
if (!processedTasks.includes(task)) {
|
|
656
|
-
postUninstallExtension(task.extension, error);
|
|
667
|
+
postUninstallExtension(task.extension, task.options, error);
|
|
657
668
|
}
|
|
658
669
|
}
|
|
659
670
|
throw error;
|
|
660
671
|
}
|
|
661
672
|
finally {
|
|
662
673
|
for (const task of allTasks) {
|
|
663
|
-
if (!this.uninstallingExtensions.delete(getUninstallExtensionTaskKey(task.extension.
|
|
674
|
+
if (!this.uninstallingExtensions.delete(getUninstallExtensionTaskKey(task.extension, task.options))) {
|
|
664
675
|
this.logService.warn('Uninstallation task is not found in the cache', task.extension.identifier.id);
|
|
665
676
|
}
|
|
666
677
|
}
|
|
@@ -682,27 +693,24 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
682
693
|
getDependentsErrorMessage(dependingExtension, dependents, extensionToUninstall) {
|
|
683
694
|
if (extensionToUninstall === dependingExtension) {
|
|
684
695
|
if (dependents.length === 1) {
|
|
685
|
-
return (
|
|
686
|
-
|
|
687
|
-
7,
|
|
696
|
+
return ( localize(
|
|
697
|
+
11116,
|
|
688
698
|
"Cannot uninstall '{0}' extension. '{1}' extension depends on this.",
|
|
689
699
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
690
700
|
dependents[0].manifest.displayName || dependents[0].manifest.name
|
|
691
701
|
));
|
|
692
702
|
}
|
|
693
703
|
if (dependents.length === 2) {
|
|
694
|
-
return (
|
|
695
|
-
|
|
696
|
-
8,
|
|
704
|
+
return ( localize(
|
|
705
|
+
11117,
|
|
697
706
|
"Cannot uninstall '{0}' extension. '{1}' and '{2}' extensions depend on this.",
|
|
698
707
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
699
708
|
dependents[0].manifest.displayName || dependents[0].manifest.name,
|
|
700
709
|
dependents[1].manifest.displayName || dependents[1].manifest.name
|
|
701
710
|
));
|
|
702
711
|
}
|
|
703
|
-
return (
|
|
704
|
-
|
|
705
|
-
9,
|
|
712
|
+
return ( localize(
|
|
713
|
+
11118,
|
|
706
714
|
"Cannot uninstall '{0}' extension. '{1}', '{2}' and other extension depend on this.",
|
|
707
715
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
708
716
|
dependents[0].manifest.displayName || dependents[0].manifest.name,
|
|
@@ -710,9 +718,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
710
718
|
));
|
|
711
719
|
}
|
|
712
720
|
if (dependents.length === 1) {
|
|
713
|
-
return (
|
|
714
|
-
|
|
715
|
-
10,
|
|
721
|
+
return ( localize(
|
|
722
|
+
11119,
|
|
716
723
|
"Cannot uninstall '{0}' extension . It includes uninstalling '{1}' extension and '{2}' extension depends on this.",
|
|
717
724
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
718
725
|
dependingExtension.manifest.displayName
|
|
@@ -721,9 +728,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
721
728
|
));
|
|
722
729
|
}
|
|
723
730
|
if (dependents.length === 2) {
|
|
724
|
-
return (
|
|
725
|
-
|
|
726
|
-
11,
|
|
731
|
+
return ( localize(
|
|
732
|
+
11120,
|
|
727
733
|
"Cannot uninstall '{0}' extension. It includes uninstalling '{1}' extension and '{2}' and '{3}' extensions depend on this.",
|
|
728
734
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
729
735
|
dependingExtension.manifest.displayName
|
|
@@ -732,9 +738,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
732
738
|
dependents[1].manifest.displayName || dependents[1].manifest.name
|
|
733
739
|
));
|
|
734
740
|
}
|
|
735
|
-
return (
|
|
736
|
-
|
|
737
|
-
12,
|
|
741
|
+
return ( localize(
|
|
742
|
+
11121,
|
|
738
743
|
"Cannot uninstall '{0}' extension. It includes uninstalling '{1}' extension and '{2}', '{3}' and other extensions depend on this.",
|
|
739
744
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
740
745
|
dependingExtension.manifest.displayName
|
|
@@ -74,6 +74,7 @@ const PropertyType = {
|
|
|
74
74
|
WebExtension: 'Microsoft.VisualStudio.Code.WebExtension',
|
|
75
75
|
SponsorLink: 'Microsoft.VisualStudio.Code.SponsorLink',
|
|
76
76
|
SupportLink: 'Microsoft.VisualStudio.Services.Links.Support',
|
|
77
|
+
ExecutesCode: 'Microsoft.VisualStudio.Code.ExecutesCode',
|
|
77
78
|
};
|
|
78
79
|
const DefaultPageSize = 10;
|
|
79
80
|
const DefaultQueryState = {
|
|
@@ -191,6 +192,10 @@ function isPreReleaseVersion(version) {
|
|
|
191
192
|
const values = version.properties ? version.properties.filter(p => p.key === PropertyType.PreRelease) : [];
|
|
192
193
|
return values.length > 0 && values[0].value === 'true';
|
|
193
194
|
}
|
|
195
|
+
function executesCode(version) {
|
|
196
|
+
const values = version.properties ? version.properties.filter(p => p.key === PropertyType.ExecutesCode) : [];
|
|
197
|
+
return values.length > 0 ? values[0].value === 'true' : undefined;
|
|
198
|
+
}
|
|
194
199
|
function getEnabledApiProposals(version) {
|
|
195
200
|
const values = version.properties ? version.properties.filter(p => p.key === PropertyType.EnabledApiProposals) : [];
|
|
196
201
|
const value = (values.length > 0 && values[0].value) || '';
|
|
@@ -295,7 +300,8 @@ function toExtension(galleryExtension, version, allTargetPlatforms, queryContext
|
|
|
295
300
|
enabledApiProposals: getEnabledApiProposals(version),
|
|
296
301
|
localizedLanguages: getLocalizedLanguages(version),
|
|
297
302
|
targetPlatform: getTargetPlatformForExtensionVersion(version),
|
|
298
|
-
isPreReleaseVersion: isPreReleaseVersion(version)
|
|
303
|
+
isPreReleaseVersion: isPreReleaseVersion(version),
|
|
304
|
+
executesCode: executesCode(version)
|
|
299
305
|
},
|
|
300
306
|
hasPreReleaseVersion: isPreReleaseVersion(latestVersion),
|
|
301
307
|
hasReleaseVersion: true,
|
|
@@ -623,9 +629,9 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
623
629
|
return {
|
|
624
630
|
galleryExtensions,
|
|
625
631
|
total,
|
|
626
|
-
context: {
|
|
632
|
+
context: context.res.headers['activityid'] ? {
|
|
627
633
|
[ACTIVITY_HEADER_NAME]: context.res.headers['activityid']
|
|
628
|
-
}
|
|
634
|
+
} : {}
|
|
629
635
|
};
|
|
630
636
|
}
|
|
631
637
|
return { galleryExtensions: [], total };
|
|
@@ -57,9 +57,6 @@ class ExtensionManagementChannelClient extends Disposable {
|
|
|
57
57
|
zip(extension) {
|
|
58
58
|
return Promise.resolve(this.channel.call('zip', [extension]).then(result => URI.revive(result)));
|
|
59
59
|
}
|
|
60
|
-
unzip(zipLocation) {
|
|
61
|
-
return Promise.resolve(this.channel.call('unzip', [zipLocation]));
|
|
62
|
-
}
|
|
63
60
|
install(vsix, options) {
|
|
64
61
|
return Promise.resolve(this.channel.call('install', [vsix, options])).then(local => transformIncomingExtension(local, null));
|
|
65
62
|
}
|
|
@@ -88,6 +85,12 @@ class ExtensionManagementChannelClient extends Disposable {
|
|
|
88
85
|
}
|
|
89
86
|
return Promise.resolve(this.channel.call('uninstall', [extension, options]));
|
|
90
87
|
}
|
|
88
|
+
uninstallExtensions(extensions) {
|
|
89
|
+
if (( extensions.some(e => e.extension.isWorkspaceScoped))) {
|
|
90
|
+
throw ( new Error('Cannot uninstall a workspace extension'));
|
|
91
|
+
}
|
|
92
|
+
return Promise.resolve(this.channel.call('uninstallExtensions', [extensions]));
|
|
93
|
+
}
|
|
91
94
|
reinstallFromGallery(extension) {
|
|
92
95
|
return Promise.resolve(this.channel.call('reinstallFromGallery', [extension])).then(local => transformIncomingExtension(local, null));
|
|
93
96
|
}
|
|
@@ -99,6 +102,9 @@ class ExtensionManagementChannelClient extends Disposable {
|
|
|
99
102
|
return Promise.resolve(this.channel.call('updateMetadata', [local, metadata, extensionsProfileResource]))
|
|
100
103
|
.then(extension => transformIncomingExtension(extension, null));
|
|
101
104
|
}
|
|
105
|
+
resetPinnedStateForAllUserExtensions(pinned) {
|
|
106
|
+
return this.channel.call('resetPinnedStateForAllUserExtensions', [pinned]);
|
|
107
|
+
}
|
|
102
108
|
toggleAppliationScope(local, fromProfileLocation) {
|
|
103
109
|
return this.channel.call('toggleAppliationScope', [local, fromProfileLocation])
|
|
104
110
|
.then(extension => transformIncomingExtension(extension, null));
|