@codingame/monaco-vscode-extension-gallery-service-override 4.5.0 → 4.5.2

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.
Files changed (42) hide show
  1. package/index.d.ts +2 -1
  2. package/package.json +2 -2
  3. package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js +150 -97
  4. package/vscode/src/vs/platform/extensionManagement/common/extensionGalleryService.js +9 -9
  5. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementIpc.js +2 -2
  6. package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +51 -134
  7. package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +16 -15
  8. package/vscode/src/vs/workbench/contrib/extensions/browser/deprecatedExtensionsChecker.js +15 -22
  9. package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +17 -12
  10. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +117 -262
  11. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +10 -13
  12. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +66 -130
  13. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +60 -108
  14. package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +431 -723
  15. package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.web.contribution.js +2 -5
  16. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +8 -11
  17. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +11 -14
  18. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +19 -34
  19. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +15 -32
  20. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +38 -47
  21. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +195 -322
  22. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +155 -158
  23. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +98 -184
  24. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +236 -275
  25. package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +36 -40
  26. package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +9 -8
  27. package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +22 -19
  28. package/vscode/src/vs/workbench/contrib/extensions/common/reportExtensionIssueAction.js +5 -8
  29. package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +6 -13
  30. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.js +116 -70
  31. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionsProfileScannerService.js +1 -1
  32. package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +98 -94
  33. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.js +23 -35
  34. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.js +9 -16
  35. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.js +145 -197
  36. package/vscode/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.js +10 -8
  37. package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +41 -72
  38. package/vscode/src/vs/workbench/services/extensions/browser/extensionsScannerService.js +1 -1
  39. package/vscode/src/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.js +2 -2
  40. package/extensionGallery.d.ts +0 -12
  41. package/vscode/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.js +0 -334
  42. package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +0 -904
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { ExtensionGalleryOptions, default } from './extensionGallery.js';
1
+ export * from 'vscode/service-override/extensionGallery';
2
+ export { default } from 'vscode/service-override/extensionGallery';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-extension-gallery-service-override",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
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@4.5.0"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
30
30
  }
31
31
  }
@@ -19,6 +19,7 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
19
19
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
20
20
  import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
21
21
 
22
+ const _moduleId = "vs/platform/extensionManagement/common/abstractExtensionManagementService";
22
23
  let AbstractExtensionManagementService = class AbstractExtensionManagementService extends Disposable {
23
24
  get onInstallExtension() { return this._onInstallExtension.event; }
24
25
  get onDidInstallExtensions() { return this._onDidInstallExtensions.event; }
@@ -34,13 +35,13 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
34
35
  this.productService = productService;
35
36
  this.userDataProfilesService = userDataProfilesService;
36
37
  this.lastReportTimestamp = 0;
37
- this.installingExtensions = ( new Map());
38
- this.uninstallingExtensions = ( new Map());
39
- this._onInstallExtension = this._register(( new Emitter()));
40
- this._onDidInstallExtensions = this._register(( new Emitter()));
41
- this._onUninstallExtension = this._register(( new Emitter()));
42
- this._onDidUninstallExtension = this._register(( new Emitter()));
43
- this._onDidUpdateExtensionMetadata = this._register(( new Emitter()));
38
+ this.installingExtensions = ( (new Map()));
39
+ this.uninstallingExtensions = ( (new Map()));
40
+ this._onInstallExtension = this._register(( (new Emitter())));
41
+ this._onDidInstallExtensions = this._register(( (new Emitter())));
42
+ this._onUninstallExtension = this._register(( (new Emitter())));
43
+ this._onDidUninstallExtension = this._register(( (new Emitter())));
44
+ this._onDidUpdateExtensionMetadata = this._register(( (new Emitter())));
44
45
  this.participants = [];
45
46
  this._register(toDisposable(() => {
46
47
  this.installingExtensions.forEach(({ task }) => task.cancel());
@@ -51,9 +52,11 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
51
52
  }
52
53
  async canInstall(extension) {
53
54
  const currentTargetPlatform = await this.getTargetPlatform();
54
- return ( extension.allTargetPlatforms.some(
55
- targetPlatform => isTargetPlatformCompatible(targetPlatform, extension.allTargetPlatforms, currentTargetPlatform)
56
- ));
55
+ return (
56
+ (extension.allTargetPlatforms.some(
57
+ targetPlatform => isTargetPlatformCompatible(targetPlatform, extension.allTargetPlatforms, currentTargetPlatform)
58
+ ))
59
+ );
57
60
  }
58
61
  async installFromGallery(extension, options = {}) {
59
62
  try {
@@ -65,7 +68,10 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
65
68
  if (result?.error) {
66
69
  throw result.error;
67
70
  }
68
- throw new ExtensionManagementError(`Unknown error while installing extension ${extension.identifier.id}`, ExtensionManagementErrorCode.Unknown);
71
+ throw ( (new ExtensionManagementError(
72
+ `Unknown error while installing extension ${extension.identifier.id}`,
73
+ ExtensionManagementErrorCode.Unknown
74
+ )));
69
75
  }
70
76
  catch (error) {
71
77
  throw toExtensionManagementError(error);
@@ -73,11 +79,14 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
73
79
  }
74
80
  async installGalleryExtensions(extensions) {
75
81
  if (!this.galleryService.isEnabled()) {
76
- throw new ExtensionManagementError(localizeWithPath('vs/platform/extensionManagement/common/abstractExtensionManagementService', 'MarketPlaceDisabled', "Marketplace is not enabled"), ExtensionManagementErrorCode.NotAllowed);
82
+ throw ( (new ExtensionManagementError(
83
+ localizeWithPath(_moduleId, 0, "Marketplace is not enabled"),
84
+ ExtensionManagementErrorCode.NotAllowed
85
+ )));
77
86
  }
78
87
  const results = [];
79
88
  const installableExtensions = [];
80
- await Promise.allSettled(( extensions.map(async ({ extension, options }) => {
89
+ await Promise.allSettled(( (extensions.map(async ({ extension, options }) => {
81
90
  try {
82
91
  const compatible = await this.checkAndGetCompatibleVersion(extension, !!options?.installGivenVersion, !!options?.installPreReleaseVersion, options.productVersion ?? { version: this.productService.version, date: this.productService.date });
83
92
  installableExtensions.push({ ...compatible, options });
@@ -85,7 +94,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
85
94
  catch (error) {
86
95
  results.push({ identifier: extension.identifier, operation: 2 , source: extension, error });
87
96
  }
88
- })));
97
+ }))));
89
98
  if (installableExtensions.length) {
90
99
  results.push(...(await this.installExtensions(installableExtensions)));
91
100
  }
@@ -134,7 +143,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
134
143
  }
135
144
  }
136
145
  getExtensionsControlManifest() {
137
- const now = ( new Date()).getTime();
146
+ const now = ( (new Date())).getTime();
138
147
  if (!this.extensionsControlManifest || now - this.lastReportTimestamp > 1000 * 60 * 5) {
139
148
  this.extensionsControlManifest = this.updateControlCache();
140
149
  this.lastReportTimestamp = now;
@@ -146,13 +155,13 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
146
155
  }
147
156
  async installExtensions(extensions) {
148
157
  const results = [];
149
- const installingExtensionsMap = ( new Map());
158
+ const installingExtensionsMap = ( (new Map()));
150
159
  const alreadyRequestedInstallations = [];
151
160
  const successResults = [];
152
- const getInstallExtensionTaskKey = (extension, profileLocation) => `${( ExtensionKey.create(extension).toString())}-${( profileLocation.toString())}`;
161
+ const getInstallExtensionTaskKey = (extension, profileLocation) => `${( (ExtensionKey.create(extension).toString()))}-${( (profileLocation.toString()))}`;
153
162
  const createInstallExtensionTask = (manifest, extension, options) => {
154
163
  const installExtensionTask = this.createInstallExtensionTask(manifest, extension, options);
155
- const key = URI.isUri(extension) ? extension.path : `${extension.identifier.id.toLowerCase()}-${( options.profileLocation.toString())}`;
164
+ const key = URI.isUri(extension) ? extension.path : `${extension.identifier.id.toLowerCase()}-${( (options.profileLocation.toString()))}`;
156
165
  installingExtensionsMap.set(key, { task: installExtensionTask, manifest });
157
166
  this._onInstallExtension.fire({ identifier: installExtensionTask.identifier, source: extension, profileLocation: options.profileLocation });
158
167
  this.logService.info('Installing extension:', installExtensionTask.identifier.id);
@@ -179,7 +188,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
179
188
  createInstallExtensionTask(manifest, extension, installExtensionTaskOptions);
180
189
  }
181
190
  }
182
- await Promise.all(( [...( installingExtensionsMap.values())].map(async ({ task, manifest }) => {
191
+ await Promise.all(( ([...( (installingExtensionsMap.values()))].map(async ({ task, manifest }) => {
183
192
  if (task.options.donotIncludePackAndDependencies) {
184
193
  this.logService.info('Installing the extension without checking dependencies and pack', task.identifier.id);
185
194
  }
@@ -189,7 +198,9 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
189
198
  const installed = await this.getInstalled(undefined, task.options.profileLocation, task.options.productVersion);
190
199
  const options = { ...task.options, donotIncludePackAndDependencies: true, context: { ...task.options.context, [EXTENSION_INSTALL_DEP_PACK_CONTEXT]: true } };
191
200
  for (const { gallery, manifest } of distinct(allDepsAndPackExtensionsToInstall, ({ gallery }) => gallery.identifier.id)) {
192
- if (( installingExtensionsMap.has(`${gallery.identifier.id.toLowerCase()}-${( options.profileLocation.toString())}`))) {
201
+ if (( (installingExtensionsMap.has(
202
+ `${gallery.identifier.id.toLowerCase()}-${( (options.profileLocation.toString()))}`
203
+ )))) {
193
204
  continue;
194
205
  }
195
206
  const existingInstallingExtension = this.installingExtensions.get(getInstallExtensionTaskKey(gallery, options.profileLocation));
@@ -198,16 +209,16 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
198
209
  const identifier = existingInstallingExtension.task.identifier;
199
210
  this.logService.info('Waiting for already requested installing extension', identifier.id, task.identifier.id);
200
211
  existingInstallingExtension.waitingTasks.push(task);
201
- alreadyRequestedInstallations.push(Event.toPromise(Event.filter(this.onDidInstallExtensions, results => ( results.some(result => areSameExtensions(result.identifier, identifier))))).then(results => {
212
+ alreadyRequestedInstallations.push(Event.toPromise(Event.filter(this.onDidInstallExtensions, results => ( (results.some(result => areSameExtensions(result.identifier, identifier)))))).then(results => {
202
213
  this.logService.info('Finished waiting for already requested installing extension', identifier.id, task.identifier.id);
203
214
  const result = results.find(result => areSameExtensions(result.identifier, identifier));
204
215
  if (!result?.local) {
205
- throw new Error(`Extension ${identifier.id} is not installed`);
216
+ throw ( (new Error(`Extension ${identifier.id} is not installed`)));
206
217
  }
207
218
  }));
208
219
  }
209
220
  }
210
- else if (!( installed.some(({ identifier }) => areSameExtensions(identifier, gallery.identifier)))) {
221
+ else if (!( (installed.some(({ identifier }) => areSameExtensions(identifier, gallery.identifier))))) {
211
222
  createInstallExtensionTask(manifest, gallery, options);
212
223
  }
213
224
  }
@@ -227,21 +238,21 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
227
238
  }
228
239
  }
229
240
  }
230
- })));
231
- await this.joinAllSettled(( [...( installingExtensionsMap.values())].map(async ({ task }) => {
232
- const startTime = ( new Date()).getTime();
241
+ }))));
242
+ await this.joinAllSettled(( ([...( (installingExtensionsMap.values()))].map(async ({ task }) => {
243
+ const startTime = ( (new Date())).getTime();
233
244
  try {
234
245
  const local = await task.run();
235
- await this.joinAllSettled(( this.participants.map(
246
+ await this.joinAllSettled(( (this.participants.map(
236
247
  participant => participant.postInstall(local, task.source, task.options, CancellationToken.None)
237
- )));
248
+ ))));
238
249
  if (!URI.isUri(task.source)) {
239
250
  const isUpdate = task.operation === 3 ;
240
- const durationSinceUpdate = isUpdate ? undefined : (( new Date()).getTime() - task.source.lastUpdated) / 1000;
251
+ const durationSinceUpdate = isUpdate ? undefined : (( (new Date())).getTime() - task.source.lastUpdated) / 1000;
241
252
  reportTelemetry(this.telemetryService, isUpdate ? 'extensionGallery:update' : 'extensionGallery:install', {
242
253
  extensionData: getGalleryExtensionTelemetryData(task.source),
243
254
  verificationStatus: task.verificationStatus,
244
- duration: ( new Date()).getTime() - startTime,
255
+ duration: ( (new Date())).getTime() - startTime,
245
256
  durationSinceUpdate
246
257
  });
247
258
  if (isWeb && task.operation !== 3 ) {
@@ -257,7 +268,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
257
268
  this.logService.error('Error while installing the extension', task.identifier.id, getErrorMessage(error));
258
269
  throw error;
259
270
  }
260
- })));
271
+ }))));
261
272
  if (alreadyRequestedInstallations.length) {
262
273
  await this.joinAllSettled(alreadyRequestedInstallations);
263
274
  }
@@ -270,7 +281,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
270
281
  catch (error) {
271
282
  if (successResults.length) {
272
283
  this.logService.info('Rollback: Uninstalling installed extensions', getErrorMessage(error));
273
- await Promise.allSettled(( successResults.map(async ({ local, profileLocation }) => {
284
+ await Promise.allSettled(( (successResults.map(async ({ local, profileLocation }) => {
274
285
  try {
275
286
  await this.createUninstallExtensionTask(local, { versionOnly: true, profileLocation }).run();
276
287
  this.logService.info('Rollback: Uninstalled extension', local.identifier.id);
@@ -278,16 +289,16 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
278
289
  catch (error) {
279
290
  this.logService.warn('Rollback: Error while uninstalling extension', local.identifier.id, getErrorMessage(error));
280
291
  }
281
- })));
292
+ }))));
282
293
  }
283
- for (const { task } of ( installingExtensionsMap.values())) {
294
+ for (const { task } of ( (installingExtensionsMap.values()))) {
284
295
  task.cancel();
285
296
  results.push({ identifier: task.identifier, operation: 2 , source: task.source, context: task.options.context, profileLocation: task.profileLocation, error });
286
297
  }
287
298
  throw error;
288
299
  }
289
300
  finally {
290
- for (const { task } of ( installingExtensionsMap.values())) {
301
+ for (const { task } of ( (installingExtensionsMap.values()))) {
291
302
  if (task.source && !URI.isUri(task.source)) {
292
303
  this.installingExtensions.delete(getInstallExtensionTaskKey(task.source, task.profileLocation));
293
304
  }
@@ -303,7 +314,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
303
314
  if (waitingTasks.includes(taskToWaitFor)) {
304
315
  return false;
305
316
  }
306
- if (( waitingTasks.some(waitingTask => this.canWaitForTask(waitingTask, taskToWaitFor)))) {
317
+ if (( (waitingTasks.some(waitingTask => this.canWaitForTask(waitingTask, taskToWaitFor))))) {
307
318
  return false;
308
319
  }
309
320
  }
@@ -344,7 +355,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
344
355
  if (manifest.extensionPack) {
345
356
  const existing = getOnlyNewlyAddedFromExtensionPack ? installed.find(e => areSameExtensions(e.identifier, extensionIdentifier)) : undefined;
346
357
  for (const extension of manifest.extensionPack) {
347
- if (!(existing && existing.manifest.extensionPack && ( existing.manifest.extensionPack.some(old => areSameExtensions({ id: old }, { id: extension }))))) {
358
+ if (!(existing && existing.manifest.extensionPack && ( (existing.manifest.extensionPack.some(old => areSameExtensions({ id: old }, { id: extension })))))) {
348
359
  if (dependenciesAndPackExtensions.every(e => !areSameExtensions({ id: e }, { id: extension }))) {
349
360
  dependenciesAndPackExtensions.push(extension);
350
361
  }
@@ -354,12 +365,12 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
354
365
  if (dependenciesAndPackExtensions.length) {
355
366
  const ids = dependenciesAndPackExtensions.filter(id => knownIdentifiers.every(galleryIdentifier => !areSameExtensions(galleryIdentifier, { id })));
356
367
  if (ids.length) {
357
- const galleryExtensions = await this.galleryService.getExtensions(( ids.map(id => ({ id, preRelease: installPreRelease }))), CancellationToken.None);
368
+ const galleryExtensions = await this.galleryService.getExtensions(( (ids.map(id => ({ id, preRelease: installPreRelease })))), CancellationToken.None);
358
369
  for (const galleryExtension of galleryExtensions) {
359
370
  if (knownIdentifiers.find(identifier => areSameExtensions(identifier, galleryExtension.identifier))) {
360
371
  continue;
361
372
  }
362
- const isDependency = ( dependecies.some(id => areSameExtensions({ id }, galleryExtension.identifier)));
373
+ const isDependency = ( (dependecies.some(id => areSameExtensions({ id }, galleryExtension.identifier))));
363
374
  let compatible;
364
375
  try {
365
376
  compatible = await this.checkAndGetCompatibleVersion(galleryExtension, false, installPreRelease, productVersion);
@@ -385,37 +396,73 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
385
396
  async checkAndGetCompatibleVersion(extension, sameVersion, installPreRelease, productVersion) {
386
397
  let compatibleExtension;
387
398
  const extensionsControlManifest = await this.getExtensionsControlManifest();
388
- if (( extensionsControlManifest.malicious.some(identifier => areSameExtensions(extension.identifier, identifier)))) {
389
- throw new ExtensionManagementError(localizeWithPath('vs/platform/extensionManagement/common/abstractExtensionManagementService', 'malicious extension', "Can't install '{0}' extension since it was reported to be problematic.", extension.identifier.id), ExtensionManagementErrorCode.Malicious);
399
+ if (( (extensionsControlManifest.malicious.some(identifier => areSameExtensions(extension.identifier, identifier))))) {
400
+ throw ( (new ExtensionManagementError(localizeWithPath(
401
+ _moduleId,
402
+ 1,
403
+ "Can't install '{0}' extension since it was reported to be problematic.",
404
+ extension.identifier.id
405
+ ), ExtensionManagementErrorCode.Malicious)));
390
406
  }
391
407
  const deprecationInfo = extensionsControlManifest.deprecated[extension.identifier.id.toLowerCase()];
392
408
  if (deprecationInfo?.extension?.autoMigrate) {
393
409
  this.logService.info(`The '${extension.identifier.id}' extension is deprecated, fetching the compatible '${deprecationInfo.extension.id}' extension instead.`);
394
410
  compatibleExtension = (await this.galleryService.getExtensions([{ id: deprecationInfo.extension.id, preRelease: deprecationInfo.extension.preRelease }], { targetPlatform: await this.getTargetPlatform(), compatible: true, productVersion }, CancellationToken.None))[0];
395
411
  if (!compatibleExtension) {
396
- throw new ExtensionManagementError(localizeWithPath('vs/platform/extensionManagement/common/abstractExtensionManagementService', 'notFoundDeprecatedReplacementExtension', "Can't install '{0}' extension since it was deprecated and the replacement extension '{1}' can't be found.", extension.identifier.id, deprecationInfo.extension.id), ExtensionManagementErrorCode.Deprecated);
412
+ throw ( (new ExtensionManagementError(localizeWithPath(
413
+ _moduleId,
414
+ 2,
415
+ "Can't install '{0}' extension since it was deprecated and the replacement extension '{1}' can't be found.",
416
+ extension.identifier.id,
417
+ deprecationInfo.extension.id
418
+ ), ExtensionManagementErrorCode.Deprecated)));
397
419
  }
398
420
  }
399
421
  else {
400
422
  if (!(await this.canInstall(extension))) {
401
423
  const targetPlatform = await this.getTargetPlatform();
402
- throw new ExtensionManagementError(localizeWithPath('vs/platform/extensionManagement/common/abstractExtensionManagementService', 'incompatible platform', "The '{0}' extension is not available in {1} for {2}.", extension.identifier.id, this.productService.nameLong, TargetPlatformToString(targetPlatform)), ExtensionManagementErrorCode.IncompatibleTargetPlatform);
424
+ throw ( (new ExtensionManagementError(localizeWithPath(
425
+ _moduleId,
426
+ 3,
427
+ "The '{0}' extension is not available in {1} for {2}.",
428
+ extension.identifier.id,
429
+ this.productService.nameLong,
430
+ TargetPlatformToString(targetPlatform)
431
+ ), ExtensionManagementErrorCode.IncompatibleTargetPlatform)));
403
432
  }
404
433
  compatibleExtension = await this.getCompatibleVersion(extension, sameVersion, installPreRelease, productVersion);
405
434
  if (!compatibleExtension) {
406
435
  if (!installPreRelease && extension.properties.isPreReleaseVersion && (await this.galleryService.getExtensions([extension.identifier], CancellationToken.None))[0]) {
407
- throw new ExtensionManagementError(localizeWithPath('vs/platform/extensionManagement/common/abstractExtensionManagementService', 'notFoundReleaseExtension', "Can't install release version of '{0}' extension because it has no release version.", extension.displayName ?? extension.identifier.id), ExtensionManagementErrorCode.ReleaseVersionNotFound);
436
+ throw ( (new ExtensionManagementError(localizeWithPath(
437
+ _moduleId,
438
+ 4,
439
+ "Can't install release version of '{0}' extension because it has no release version.",
440
+ extension.displayName ?? extension.identifier.id
441
+ ), ExtensionManagementErrorCode.ReleaseVersionNotFound)));
408
442
  }
409
- throw new ExtensionManagementError(localizeWithPath('vs/platform/extensionManagement/common/abstractExtensionManagementService', 'notFoundCompatibleDependency', "Can't install '{0}' extension because it is not compatible with the current version of {1} (version {2}).", extension.identifier.id, this.productService.nameLong, this.productService.version), ExtensionManagementErrorCode.Incompatible);
443
+ throw ( (new ExtensionManagementError(localizeWithPath(
444
+ _moduleId,
445
+ 5,
446
+ "Can't install '{0}' extension because it is not compatible with the current version of {1} (version {2}).",
447
+ extension.identifier.id,
448
+ this.productService.nameLong,
449
+ this.productService.version
450
+ ), ExtensionManagementErrorCode.Incompatible)));
410
451
  }
411
452
  }
412
453
  this.logService.info('Getting Manifest...', compatibleExtension.identifier.id);
413
454
  const manifest = await this.galleryService.getManifest(compatibleExtension, CancellationToken.None);
414
455
  if (manifest === null) {
415
- throw new ExtensionManagementError(`Missing manifest for extension ${compatibleExtension.identifier.id}`, ExtensionManagementErrorCode.Invalid);
456
+ throw ( (new ExtensionManagementError(
457
+ `Missing manifest for extension ${compatibleExtension.identifier.id}`,
458
+ ExtensionManagementErrorCode.Invalid
459
+ )));
416
460
  }
417
461
  if (manifest.version !== compatibleExtension.version) {
418
- throw new ExtensionManagementError(`Cannot install '${compatibleExtension.identifier.id}' extension because of version mismatch in Marketplace`, ExtensionManagementErrorCode.Invalid);
462
+ throw ( (new ExtensionManagementError(
463
+ `Cannot install '${compatibleExtension.identifier.id}' extension because of version mismatch in Marketplace`,
464
+ ExtensionManagementErrorCode.Invalid
465
+ )));
419
466
  }
420
467
  return { extension: compatibleExtension, manifest };
421
468
  }
@@ -443,7 +490,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
443
490
  ...options,
444
491
  profileLocation: extension.isApplicationScoped ? this.userDataProfilesService.defaultProfile.extensionsResource : options.profileLocation ?? this.getCurrentExtensionsManifestLocation()
445
492
  };
446
- const getUninstallExtensionTaskKey = (identifier) => `${identifier.id.toLowerCase()}${uninstallOptions.versionOnly ? `-${extension.manifest.version}` : ''}${uninstallOptions.profileLocation ? `@${( uninstallOptions.profileLocation.toString())}` : ''}`;
493
+ const getUninstallExtensionTaskKey = (identifier) => `${identifier.id.toLowerCase()}${uninstallOptions.versionOnly ? `-${extension.manifest.version}` : ''}${uninstallOptions.profileLocation ? `@${( (uninstallOptions.profileLocation.toString()))}` : ''}`;
447
494
  const uninstallExtensionTask = this.uninstallingExtensions.get(getUninstallExtensionTaskKey(extension.identifier));
448
495
  if (uninstallExtensionTask) {
449
496
  this.logService.info('Extensions is already requested to uninstall', extension.identifier.id);
@@ -453,7 +500,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
453
500
  const uninstallExtensionTask = this.createUninstallExtensionTask(extension, uninstallOptions);
454
501
  this.uninstallingExtensions.set(getUninstallExtensionTaskKey(uninstallExtensionTask.extension.identifier), uninstallExtensionTask);
455
502
  if (uninstallOptions.profileLocation) {
456
- this.logService.info('Uninstalling extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( uninstallOptions.profileLocation.toString()));
503
+ this.logService.info('Uninstalling extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())));
457
504
  }
458
505
  else {
459
506
  this.logService.info('Uninstalling extension:', `${extension.identifier.id}@${extension.manifest.version}`);
@@ -464,7 +511,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
464
511
  const postUninstallExtension = (extension, error) => {
465
512
  if (error) {
466
513
  if (uninstallOptions.profileLocation) {
467
- this.logService.error('Failed to uninstall extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( uninstallOptions.profileLocation.toString()), error.message);
514
+ this.logService.error('Failed to uninstall extension from the profile:', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())), error.message);
468
515
  }
469
516
  else {
470
517
  this.logService.error('Failed to uninstall extension:', `${extension.identifier.id}@${extension.manifest.version}`, error.message);
@@ -472,7 +519,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
472
519
  }
473
520
  else {
474
521
  if (uninstallOptions.profileLocation) {
475
- this.logService.info('Successfully uninstalled extension from the profile', `${extension.identifier.id}@${extension.manifest.version}`, ( uninstallOptions.profileLocation.toString()));
522
+ this.logService.info('Successfully uninstalled extension from the profile', `${extension.identifier.id}@${extension.manifest.version}`, ( (uninstallOptions.profileLocation.toString())));
476
523
  }
477
524
  else {
478
525
  this.logService.info('Successfully uninstalled extension:', `${extension.identifier.id}@${extension.manifest.version}`);
@@ -492,7 +539,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
492
539
  else {
493
540
  const packedExtensions = this.getAllPackExtensionsToUninstall(extension, installed);
494
541
  for (const packedExtension of packedExtensions) {
495
- if (( this.uninstallingExtensions.has(getUninstallExtensionTaskKey(packedExtension.identifier)))) {
542
+ if (( (this.uninstallingExtensions.has(getUninstallExtensionTaskKey(packedExtension.identifier))))) {
496
543
  this.logService.info('Extensions is already requested to uninstall', packedExtension.identifier.id);
497
544
  }
498
545
  else {
@@ -504,14 +551,14 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
504
551
  this.logService.info('Uninstalling the extension without checking dependents', `${extension.identifier.id}@${extension.manifest.version}`);
505
552
  }
506
553
  else {
507
- this.checkForDependents(( allTasks.map(task => task.extension)), installed, extension);
554
+ this.checkForDependents(( (allTasks.map(task => task.extension))), installed, extension);
508
555
  }
509
- await this.joinAllSettled(( allTasks.map(async (task) => {
556
+ await this.joinAllSettled(( (allTasks.map(async (task) => {
510
557
  try {
511
558
  await task.run();
512
- await this.joinAllSettled(( this.participants.map(
559
+ await this.joinAllSettled(( (this.participants.map(
513
560
  participant => participant.postUninstall(task.extension, uninstallOptions, CancellationToken.None)
514
- )));
561
+ ))));
515
562
  if (task.extension.identifier.uuid) {
516
563
  try {
517
564
  await this.galleryService.reportStatistic(task.extension.manifest.publisher, task.extension.manifest.name, task.extension.manifest.version, "uninstall" );
@@ -521,17 +568,17 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
521
568
  postUninstallExtension(task.extension);
522
569
  }
523
570
  catch (e) {
524
- const error = e instanceof ExtensionManagementError ? e : ( new ExtensionManagementError(getErrorMessage(e), ExtensionManagementErrorCode.Internal));
571
+ const error = e instanceof ExtensionManagementError ? e : ( (new ExtensionManagementError(getErrorMessage(e), ExtensionManagementErrorCode.Internal)));
525
572
  postUninstallExtension(task.extension, error);
526
573
  throw error;
527
574
  }
528
575
  finally {
529
576
  processedTasks.push(task);
530
577
  }
531
- })));
578
+ }))));
532
579
  }
533
580
  catch (e) {
534
- const error = e instanceof ExtensionManagementError ? e : ( new ExtensionManagementError(getErrorMessage(e), ExtensionManagementErrorCode.Internal));
581
+ const error = e instanceof ExtensionManagementError ? e : ( (new ExtensionManagementError(getErrorMessage(e), ExtensionManagementErrorCode.Internal)));
535
582
  for (const task of allTasks) {
536
583
  try {
537
584
  task.cancel();
@@ -555,9 +602,11 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
555
602
  for (const extension of extensionsToUninstall) {
556
603
  const dependents = this.getDependents(extension, installed);
557
604
  if (dependents.length) {
558
- const remainingDependents = dependents.filter(dependent => !( extensionsToUninstall.some(e => areSameExtensions(e.identifier, dependent.identifier))));
605
+ const remainingDependents = dependents.filter(dependent => !( (extensionsToUninstall.some(e => areSameExtensions(e.identifier, dependent.identifier)))));
559
606
  if (remainingDependents.length) {
560
- throw new Error(this.getDependentsErrorMessage(extension, remainingDependents, extensionToUninstall));
607
+ throw ( (new Error(
608
+ this.getDependentsErrorMessage(extension, remainingDependents, extensionToUninstall)
609
+ )));
561
610
  }
562
611
  }
563
612
  }
@@ -566,8 +615,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
566
615
  if (extensionToUninstall === dependingExtension) {
567
616
  if (dependents.length === 1) {
568
617
  return ( localizeWithPath(
569
- 'vs/platform/extensionManagement/common/abstractExtensionManagementService',
570
- 'singleDependentError',
618
+ _moduleId,
619
+ 6,
571
620
  "Cannot uninstall '{0}' extension. '{1}' extension depends on this.",
572
621
  extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
573
622
  dependents[0].manifest.displayName || dependents[0].manifest.name
@@ -575,8 +624,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
575
624
  }
576
625
  if (dependents.length === 2) {
577
626
  return ( localizeWithPath(
578
- 'vs/platform/extensionManagement/common/abstractExtensionManagementService',
579
- 'twoDependentsError',
627
+ _moduleId,
628
+ 7,
580
629
  "Cannot uninstall '{0}' extension. '{1}' and '{2}' extensions depend on this.",
581
630
  extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
582
631
  dependents[0].manifest.displayName || dependents[0].manifest.name,
@@ -584,8 +633,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
584
633
  ));
585
634
  }
586
635
  return ( localizeWithPath(
587
- 'vs/platform/extensionManagement/common/abstractExtensionManagementService',
588
- 'multipleDependentsError',
636
+ _moduleId,
637
+ 8,
589
638
  "Cannot uninstall '{0}' extension. '{1}', '{2}' and other extension depend on this.",
590
639
  extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
591
640
  dependents[0].manifest.displayName || dependents[0].manifest.name,
@@ -594,8 +643,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
594
643
  }
595
644
  if (dependents.length === 1) {
596
645
  return ( localizeWithPath(
597
- 'vs/platform/extensionManagement/common/abstractExtensionManagementService',
598
- 'singleIndirectDependentError',
646
+ _moduleId,
647
+ 9,
599
648
  "Cannot uninstall '{0}' extension . It includes uninstalling '{1}' extension and '{2}' extension depends on this.",
600
649
  extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
601
650
  dependingExtension.manifest.displayName
@@ -605,8 +654,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
605
654
  }
606
655
  if (dependents.length === 2) {
607
656
  return ( localizeWithPath(
608
- 'vs/platform/extensionManagement/common/abstractExtensionManagementService',
609
- 'twoIndirectDependentsError',
657
+ _moduleId,
658
+ 10,
610
659
  "Cannot uninstall '{0}' extension. It includes uninstalling '{1}' extension and '{2}' and '{3}' extensions depend on this.",
611
660
  extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
612
661
  dependingExtension.manifest.displayName
@@ -616,8 +665,8 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
616
665
  ));
617
666
  }
618
667
  return ( localizeWithPath(
619
- 'vs/platform/extensionManagement/common/abstractExtensionManagementService',
620
- 'multipleIndirectDependentsError',
668
+ _moduleId,
669
+ 11,
621
670
  "Cannot uninstall '{0}' extension. It includes uninstalling '{1}' extension and '{2}', '{3}' and other extensions depend on this.",
622
671
  extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
623
672
  dependingExtension.manifest.displayName
@@ -633,7 +682,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
633
682
  checked.push(extension);
634
683
  const extensionsPack = extension.manifest.extensionPack ? extension.manifest.extensionPack : [];
635
684
  if (extensionsPack.length) {
636
- const packedExtensions = installed.filter(i => !i.isBuiltin && ( extensionsPack.some(id => areSameExtensions({ id }, i.identifier))));
685
+ const packedExtensions = installed.filter(i => !i.isBuiltin && ( (extensionsPack.some(id => areSameExtensions({ id }, i.identifier)))));
637
686
  const packOfPackedExtensions = [];
638
687
  for (const packedExtension of packedExtensions) {
639
688
  packOfPackedExtensions.push(...this.getAllPackExtensionsToUninstall(packedExtension, installed, checked));
@@ -643,7 +692,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
643
692
  return [];
644
693
  }
645
694
  getDependents(extension, installed) {
646
- return installed.filter(e => e.manifest.extensionDependencies && ( e.manifest.extensionDependencies.some(id => areSameExtensions({ id }, extension.identifier))));
695
+ return installed.filter(e => e.manifest.extensionDependencies && ( (e.manifest.extensionDependencies.some(id => areSameExtensions({ id }, extension.identifier)))));
647
696
  }
648
697
  async updateControlCache() {
649
698
  try {
@@ -656,35 +705,37 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
656
705
  }
657
706
  }
658
707
  };
659
- AbstractExtensionManagementService = ( __decorate([
660
- ( __param(0, IExtensionGalleryService)),
661
- ( __param(1, ITelemetryService)),
662
- ( __param(2, IUriIdentityService)),
663
- ( __param(3, ILogService)),
664
- ( __param(4, IProductService)),
665
- ( __param(5, IUserDataProfilesService))
666
- ], AbstractExtensionManagementService));
708
+ AbstractExtensionManagementService = ( (__decorate([
709
+ ( (__param(0, IExtensionGalleryService))),
710
+ ( (__param(1, ITelemetryService))),
711
+ ( (__param(2, IUriIdentityService))),
712
+ ( (__param(3, ILogService))),
713
+ ( (__param(4, IProductService))),
714
+ ( (__param(5, IUserDataProfilesService)))
715
+ ], AbstractExtensionManagementService)));
667
716
  function joinErrors(errorOrErrors) {
668
717
  const errors = Array.isArray(errorOrErrors) ? errorOrErrors : [errorOrErrors];
669
718
  if (errors.length === 1) {
670
- return errors[0] instanceof Error ? errors[0] : ( new Error(errors[0]));
719
+ return errors[0] instanceof Error ? errors[0] : ( (new Error(errors[0])));
671
720
  }
672
721
  return errors.reduce((previousValue, currentValue) => {
673
- return ( new Error(
674
- `${previousValue.message}${previousValue.message ? ',' : ''}${currentValue instanceof Error ? currentValue.message : currentValue}`
675
- ));
676
- }, ( new Error('')));
722
+ return (
723
+ (new Error(
724
+ `${previousValue.message}${previousValue.message ? ',' : ''}${currentValue instanceof Error ? currentValue.message : currentValue}`
725
+ ))
726
+ );
727
+ }, ( (new Error(''))));
677
728
  }
678
729
  function toExtensionManagementError(error) {
679
730
  if (error instanceof ExtensionManagementError) {
680
731
  return error;
681
732
  }
682
733
  if (error instanceof ExtensionGalleryError) {
683
- const e = ( new ExtensionManagementError(error.message, ExtensionManagementErrorCode.Gallery));
734
+ const e = ( (new ExtensionManagementError(error.message, ExtensionManagementErrorCode.Gallery)));
684
735
  e.stack = error.stack;
685
736
  return e;
686
737
  }
687
- const e = ( new ExtensionManagementError(error.message, ExtensionManagementErrorCode.Internal));
738
+ const e = ( (new ExtensionManagementError(error.message, ExtensionManagementErrorCode.Internal)));
688
739
  e.stack = error.stack;
689
740
  return e;
690
741
  }
@@ -719,7 +770,7 @@ function reportTelemetry(telemetryService, eventName, { extensionData, verificat
719
770
  }
720
771
  class AbstractExtensionTask {
721
772
  constructor() {
722
- this.barrier = ( new Barrier());
773
+ this.barrier = ( (new Barrier()));
723
774
  }
724
775
  async waitUntilTaskIsFinished() {
725
776
  await this.barrier.wait();
@@ -735,12 +786,14 @@ class AbstractExtensionTask {
735
786
  cancel() {
736
787
  if (!this.cancellablePromise) {
737
788
  this.cancellablePromise = createCancelablePromise(token => {
738
- return ( new Promise((c, e) => {
739
- const disposable = token.onCancellationRequested(() => {
740
- disposable.dispose();
741
- e(( new CancellationError()));
742
- });
743
- }));
789
+ return (
790
+ (new Promise((c, e) => {
791
+ const disposable = token.onCancellationRequested(() => {
792
+ disposable.dispose();
793
+ e(( (new CancellationError())));
794
+ });
795
+ }))
796
+ );
744
797
  });
745
798
  this.barrier.open();
746
799
  }