@codingame/monaco-vscode-extension-gallery-service-override 4.5.2 → 5.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/package.json +2 -2
- package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js +106 -69
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +25 -22
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +16 -14
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +31 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +1 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +83 -51
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +29 -21
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +33 -15
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +7 -12
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.js +27 -61
- package/vscode/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extension-gallery-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.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@5.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js
CHANGED
|
@@ -2,7 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { distinct, isNonEmptyArray } from 'vscode/vscode/vs/base/common/arrays';
|
|
3
3
|
import { Barrier, createCancelablePromise } from 'vscode/vscode/vs/base/common/async';
|
|
4
4
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
5
|
-
import { getErrorMessage, CancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
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
8
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
@@ -11,7 +11,7 @@ import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
|
11
11
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
12
12
|
import { isTargetPlatformCompatible, ExtensionManagementError, ExtensionManagementErrorCode, EXTENSION_INSTALL_DEP_PACK_CONTEXT, TargetPlatformToString, ExtensionGalleryError } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
13
13
|
import { IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
14
|
-
import { areSameExtensions,
|
|
14
|
+
import { areSameExtensions, ExtensionKey, getGalleryExtensionId, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
15
15
|
import { isApplicationScopedExtension } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
16
16
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
17
17
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
@@ -98,15 +98,6 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
98
98
|
if (installableExtensions.length) {
|
|
99
99
|
results.push(...(await this.installExtensions(installableExtensions)));
|
|
100
100
|
}
|
|
101
|
-
for (const result of results) {
|
|
102
|
-
if (result.error) {
|
|
103
|
-
this.logService.error(`Failed to install extension.`, result.identifier.id);
|
|
104
|
-
this.logService.error(result.error);
|
|
105
|
-
if (result.source && !URI.isUri(result.source)) {
|
|
106
|
-
reportTelemetry(this.telemetryService, 'extensionGallery:install', { extensionData: getGalleryExtensionTelemetryData(result.source), error: result.error });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
101
|
return results;
|
|
111
102
|
}
|
|
112
103
|
async uninstall(extension, options = {}) {
|
|
@@ -154,15 +145,14 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
154
145
|
this.participants.push(participant);
|
|
155
146
|
}
|
|
156
147
|
async installExtensions(extensions) {
|
|
157
|
-
const
|
|
148
|
+
const installExtensionResultsMap = ( (new Map()));
|
|
158
149
|
const installingExtensionsMap = ( (new Map()));
|
|
159
150
|
const alreadyRequestedInstallations = [];
|
|
160
|
-
const successResults = [];
|
|
161
151
|
const getInstallExtensionTaskKey = (extension, profileLocation) => `${( (ExtensionKey.create(extension).toString()))}-${( (profileLocation.toString()))}`;
|
|
162
|
-
const createInstallExtensionTask = (manifest, extension, options) => {
|
|
152
|
+
const createInstallExtensionTask = (manifest, extension, options, root) => {
|
|
163
153
|
const installExtensionTask = this.createInstallExtensionTask(manifest, extension, options);
|
|
164
|
-
const key =
|
|
165
|
-
installingExtensionsMap.set(key, { task: installExtensionTask,
|
|
154
|
+
const key = `${getGalleryExtensionId(manifest.publisher, manifest.name)}-${( (options.profileLocation.toString()))}`;
|
|
155
|
+
installingExtensionsMap.set(key, { task: installExtensionTask, root });
|
|
166
156
|
this._onInstallExtension.fire({ identifier: installExtensionTask.identifier, source: extension, profileLocation: options.profileLocation });
|
|
167
157
|
this.logService.info('Installing extension:', installExtensionTask.identifier.id);
|
|
168
158
|
if (!URI.isUri(extension)) {
|
|
@@ -185,18 +175,18 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
185
175
|
alreadyRequestedInstallations.push(existingInstallExtensionTask.task.waitUntilTaskIsFinished());
|
|
186
176
|
}
|
|
187
177
|
else {
|
|
188
|
-
createInstallExtensionTask(manifest, extension, installExtensionTaskOptions);
|
|
178
|
+
createInstallExtensionTask(manifest, extension, installExtensionTaskOptions, undefined);
|
|
189
179
|
}
|
|
190
180
|
}
|
|
191
|
-
await Promise.all(( ([...( (installingExtensionsMap.values()))].map(async ({ task
|
|
181
|
+
await Promise.all(( ([...( (installingExtensionsMap.values()))].map(async ({ task }) => {
|
|
192
182
|
if (task.options.donotIncludePackAndDependencies) {
|
|
193
183
|
this.logService.info('Installing the extension without checking dependencies and pack', task.identifier.id);
|
|
194
184
|
}
|
|
195
185
|
else {
|
|
196
186
|
try {
|
|
197
|
-
const allDepsAndPackExtensionsToInstall = await this.getAllDepsAndPackExtensions(task.identifier, manifest, !!task.options.installOnlyNewlyAddedFromExtensionPack, !!task.options.installPreReleaseVersion, task.options.profileLocation, task.options.productVersion);
|
|
187
|
+
const allDepsAndPackExtensionsToInstall = await this.getAllDepsAndPackExtensions(task.identifier, task.manifest, !!task.options.installOnlyNewlyAddedFromExtensionPack, !!task.options.installPreReleaseVersion, task.options.profileLocation, task.options.productVersion);
|
|
198
188
|
const installed = await this.getInstalled(undefined, task.options.profileLocation, task.options.productVersion);
|
|
199
|
-
const options = { ...task.options,
|
|
189
|
+
const options = { ...task.options, context: { ...task.options.context, [EXTENSION_INSTALL_DEP_PACK_CONTEXT]: true } };
|
|
200
190
|
for (const { gallery, manifest } of distinct(allDepsAndPackExtensionsToInstall, ({ gallery }) => gallery.identifier.id)) {
|
|
201
191
|
if (( (installingExtensionsMap.has(
|
|
202
192
|
`${gallery.identifier.id.toLowerCase()}-${( (options.profileLocation.toString()))}`
|
|
@@ -219,16 +209,16 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
219
209
|
}
|
|
220
210
|
}
|
|
221
211
|
else if (!( (installed.some(({ identifier }) => areSameExtensions(identifier, gallery.identifier))))) {
|
|
222
|
-
createInstallExtensionTask(manifest, gallery, options);
|
|
212
|
+
createInstallExtensionTask(manifest, gallery, options, task);
|
|
223
213
|
}
|
|
224
214
|
}
|
|
225
215
|
}
|
|
226
216
|
catch (error) {
|
|
227
217
|
if (URI.isUri(task.source)) {
|
|
228
|
-
if (isNonEmptyArray(manifest.extensionDependencies)) {
|
|
218
|
+
if (isNonEmptyArray(task.manifest.extensionDependencies)) {
|
|
229
219
|
this.logService.warn(`Cannot install dependencies of extension:`, task.identifier.id, error.message);
|
|
230
220
|
}
|
|
231
|
-
if (isNonEmptyArray(manifest.extensionPack)) {
|
|
221
|
+
if (isNonEmptyArray(task.manifest.extensionPack)) {
|
|
232
222
|
this.logService.warn(`Cannot install packed extensions of extension:`, task.identifier.id, error.message);
|
|
233
223
|
}
|
|
234
224
|
}
|
|
@@ -239,7 +229,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
239
229
|
}
|
|
240
230
|
}
|
|
241
231
|
}))));
|
|
242
|
-
await this.joinAllSettled(( ([...
|
|
232
|
+
await this.joinAllSettled(( ([...installingExtensionsMap.entries()].map(async ([key, { task }]) => {
|
|
243
233
|
const startTime = ( (new Date())).getTime();
|
|
244
234
|
try {
|
|
245
235
|
const local = await task.run();
|
|
@@ -262,9 +252,14 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
262
252
|
catch (error) { }
|
|
263
253
|
}
|
|
264
254
|
}
|
|
265
|
-
|
|
255
|
+
installExtensionResultsMap.set(key, { local, identifier: task.identifier, operation: task.operation, source: task.source, context: task.options.context, profileLocation: task.profileLocation, applicationScoped: local.isApplicationScoped });
|
|
266
256
|
}
|
|
267
|
-
catch (
|
|
257
|
+
catch (e) {
|
|
258
|
+
const error = toExtensionManagementError(e);
|
|
259
|
+
if (!URI.isUri(task.source)) {
|
|
260
|
+
reportTelemetry(this.telemetryService, task.operation === 3 ? 'extensionGallery:update' : 'extensionGallery:install', { extensionData: getGalleryExtensionTelemetryData(task.source), error });
|
|
261
|
+
}
|
|
262
|
+
installExtensionResultsMap.set(key, { error, identifier: task.identifier, operation: task.operation, source: task.source, context: task.options.context, profileLocation: task.profileLocation, applicationScoped: task.options.isApplicationScoped });
|
|
268
263
|
this.logService.error('Error while installing the extension', task.identifier.id, getErrorMessage(error));
|
|
269
264
|
throw error;
|
|
270
265
|
}
|
|
@@ -272,29 +267,69 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
272
267
|
if (alreadyRequestedInstallations.length) {
|
|
273
268
|
await this.joinAllSettled(alreadyRequestedInstallations);
|
|
274
269
|
}
|
|
275
|
-
|
|
276
|
-
this.logService.info(`Extension installed successfully:`, result.identifier.id);
|
|
277
|
-
results.push(result);
|
|
278
|
-
}
|
|
279
|
-
return results;
|
|
270
|
+
return [...( (installExtensionResultsMap.values()))];
|
|
280
271
|
}
|
|
281
272
|
catch (error) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
273
|
+
const getAllDepsAndPacks = (extension, profileLocation, allDepsOrPacks) => {
|
|
274
|
+
const depsOrPacks = [];
|
|
275
|
+
if (extension.manifest.extensionDependencies?.length) {
|
|
276
|
+
depsOrPacks.push(...extension.manifest.extensionDependencies);
|
|
277
|
+
}
|
|
278
|
+
if (extension.manifest.extensionPack?.length) {
|
|
279
|
+
depsOrPacks.push(...extension.manifest.extensionPack);
|
|
280
|
+
}
|
|
281
|
+
for (const id of depsOrPacks) {
|
|
282
|
+
if (allDepsOrPacks.includes(id.toLowerCase())) {
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
allDepsOrPacks.push(id.toLowerCase());
|
|
286
|
+
const installed = installExtensionResultsMap.get(`${id.toLowerCase()}-${( (profileLocation.toString()))}`);
|
|
287
|
+
if (installed?.local) {
|
|
288
|
+
allDepsOrPacks = getAllDepsAndPacks(installed.local, profileLocation, allDepsOrPacks);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return allDepsOrPacks;
|
|
292
|
+
};
|
|
293
|
+
const getErrorResult = (task) => ({ identifier: task.identifier, operation: 2 , source: task.source, context: task.options.context, profileLocation: task.profileLocation, error });
|
|
294
|
+
const rollbackTasks = [];
|
|
295
|
+
for (const [key, { task, root }] of installingExtensionsMap) {
|
|
296
|
+
const result = installExtensionResultsMap.get(key);
|
|
297
|
+
if (!result) {
|
|
298
|
+
task.cancel();
|
|
299
|
+
installExtensionResultsMap.set(key, getErrorResult(task));
|
|
300
|
+
}
|
|
301
|
+
else if (result.local && root && !installExtensionResultsMap.get(`${root.identifier.id.toLowerCase()}-${( (task.profileLocation.toString()))}`)?.local) {
|
|
302
|
+
rollbackTasks.push(this.createUninstallExtensionTask(result.local, { versionOnly: true, profileLocation: task.profileLocation }));
|
|
303
|
+
installExtensionResultsMap.set(key, getErrorResult(task));
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
for (const [key, { task }] of installingExtensionsMap) {
|
|
307
|
+
const result = installExtensionResultsMap.get(key);
|
|
308
|
+
if (!result?.local) {
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
if (task.options.donotIncludePackAndDependencies) {
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
const depsOrPacks = getAllDepsAndPacks(result.local, task.profileLocation, [result.local.identifier.id.toLowerCase()]).slice(1);
|
|
315
|
+
if (( (depsOrPacks.some(depOrPack => ( (installingExtensionsMap.has(
|
|
316
|
+
`${depOrPack.toLowerCase()}-${( (task.profileLocation.toString()))}`
|
|
317
|
+
))) && !installExtensionResultsMap.get(`${depOrPack.toLowerCase()}-${( (task.profileLocation.toString()))}`)?.local)))) {
|
|
318
|
+
rollbackTasks.push(this.createUninstallExtensionTask(result.local, { versionOnly: true, profileLocation: task.profileLocation }));
|
|
319
|
+
installExtensionResultsMap.set(key, getErrorResult(task));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (rollbackTasks.length) {
|
|
323
|
+
await Promise.allSettled(( (rollbackTasks.map(async (rollbackTask) => {
|
|
285
324
|
try {
|
|
286
|
-
await
|
|
287
|
-
this.logService.info('Rollback: Uninstalled extension',
|
|
325
|
+
await rollbackTask.run();
|
|
326
|
+
this.logService.info('Rollback: Uninstalled extension', rollbackTask.extension.identifier.id);
|
|
288
327
|
}
|
|
289
328
|
catch (error) {
|
|
290
|
-
this.logService.warn('Rollback: Error while uninstalling extension',
|
|
329
|
+
this.logService.warn('Rollback: Error while uninstalling extension', rollbackTask.extension.identifier.id, getErrorMessage(error));
|
|
291
330
|
}
|
|
292
331
|
}))));
|
|
293
332
|
}
|
|
294
|
-
for (const { task } of ( (installingExtensionsMap.values()))) {
|
|
295
|
-
task.cancel();
|
|
296
|
-
results.push({ identifier: task.identifier, operation: 2 , source: task.source, context: task.options.context, profileLocation: task.profileLocation, error });
|
|
297
|
-
}
|
|
298
333
|
throw error;
|
|
299
334
|
}
|
|
300
335
|
finally {
|
|
@@ -303,7 +338,13 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
303
338
|
this.installingExtensions.delete(getInstallExtensionTaskKey(task.source, task.profileLocation));
|
|
304
339
|
}
|
|
305
340
|
}
|
|
306
|
-
if (
|
|
341
|
+
if (installExtensionResultsMap.size) {
|
|
342
|
+
const results = [...( (installExtensionResultsMap.values()))];
|
|
343
|
+
for (const result of results) {
|
|
344
|
+
if (result.local) {
|
|
345
|
+
this.logService.info(`Extension installed successfully:`, result.identifier.id);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
307
348
|
this._onDidInstallExtensions.fire(results);
|
|
308
349
|
}
|
|
309
350
|
}
|
|
@@ -337,7 +378,18 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
337
378
|
}
|
|
338
379
|
}
|
|
339
380
|
if (errors.length) {
|
|
340
|
-
|
|
381
|
+
if (errors.length === 1) {
|
|
382
|
+
throw errors[0];
|
|
383
|
+
}
|
|
384
|
+
let error = ( (new ExtensionManagementError('', ExtensionManagementErrorCode.Unknown)));
|
|
385
|
+
for (const current of errors) {
|
|
386
|
+
const code = current instanceof ExtensionManagementError ? current.code : ExtensionManagementErrorCode.Unknown;
|
|
387
|
+
error = ( (new ExtensionManagementError(
|
|
388
|
+
current.message ? `${current.message}, ${error.message}` : error.message,
|
|
389
|
+
code !== ExtensionManagementErrorCode.Unknown && code !== ExtensionManagementErrorCode.Internal ? code : error.code
|
|
390
|
+
)));
|
|
391
|
+
}
|
|
392
|
+
throw error;
|
|
341
393
|
}
|
|
342
394
|
return results;
|
|
343
395
|
}
|
|
@@ -568,7 +620,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
568
620
|
postUninstallExtension(task.extension);
|
|
569
621
|
}
|
|
570
622
|
catch (e) {
|
|
571
|
-
const error =
|
|
623
|
+
const error = toExtensionManagementError(e);
|
|
572
624
|
postUninstallExtension(task.extension, error);
|
|
573
625
|
throw error;
|
|
574
626
|
}
|
|
@@ -578,7 +630,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
578
630
|
}))));
|
|
579
631
|
}
|
|
580
632
|
catch (e) {
|
|
581
|
-
const error =
|
|
633
|
+
const error = toExtensionManagementError(e);
|
|
582
634
|
for (const task of allTasks) {
|
|
583
635
|
try {
|
|
584
636
|
task.cancel();
|
|
@@ -713,19 +765,6 @@ AbstractExtensionManagementService = ( (__decorate([
|
|
|
713
765
|
( (__param(4, IProductService))),
|
|
714
766
|
( (__param(5, IUserDataProfilesService)))
|
|
715
767
|
], AbstractExtensionManagementService)));
|
|
716
|
-
function joinErrors(errorOrErrors) {
|
|
717
|
-
const errors = Array.isArray(errorOrErrors) ? errorOrErrors : [errorOrErrors];
|
|
718
|
-
if (errors.length === 1) {
|
|
719
|
-
return errors[0] instanceof Error ? errors[0] : ( (new Error(errors[0])));
|
|
720
|
-
}
|
|
721
|
-
return errors.reduce((previousValue, currentValue) => {
|
|
722
|
-
return (
|
|
723
|
-
(new Error(
|
|
724
|
-
`${previousValue.message}${previousValue.message ? ',' : ''}${currentValue instanceof Error ? currentValue.message : currentValue}`
|
|
725
|
-
))
|
|
726
|
-
);
|
|
727
|
-
}, ( (new Error(''))));
|
|
728
|
-
}
|
|
729
768
|
function toExtensionManagementError(error) {
|
|
730
769
|
if (error instanceof ExtensionManagementError) {
|
|
731
770
|
return error;
|
|
@@ -735,7 +774,10 @@ function toExtensionManagementError(error) {
|
|
|
735
774
|
e.stack = error.stack;
|
|
736
775
|
return e;
|
|
737
776
|
}
|
|
738
|
-
const e = ( (new ExtensionManagementError(
|
|
777
|
+
const e = ( (new ExtensionManagementError(
|
|
778
|
+
error.message,
|
|
779
|
+
isCancellationError(error) ? ExtensionManagementErrorCode.Cancelled : ExtensionManagementErrorCode.Internal
|
|
780
|
+
)));
|
|
739
781
|
e.stack = error.stack;
|
|
740
782
|
return e;
|
|
741
783
|
}
|
|
@@ -756,14 +798,9 @@ function reportTelemetry(telemetryService, eventName, { extensionData, verificat
|
|
|
756
798
|
}
|
|
757
799
|
}
|
|
758
800
|
if (error) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
errorcodeDetail = error.message;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
else {
|
|
766
|
-
errorcode = ExtensionManagementErrorCode.Internal;
|
|
801
|
+
errorcode = error.code;
|
|
802
|
+
if (error.code === ExtensionManagementErrorCode.Signature) {
|
|
803
|
+
errorcodeDetail = error.message;
|
|
767
804
|
}
|
|
768
805
|
}
|
|
769
806
|
telemetryService.publicLog(eventName, { ...extensionData, verificationStatus, success: !error, duration, errorcode, errorcodeDetail, durationSinceUpdate });
|
|
@@ -776,7 +813,7 @@ class AbstractExtensionTask {
|
|
|
776
813
|
await this.barrier.wait();
|
|
777
814
|
return this.cancellablePromise;
|
|
778
815
|
}
|
|
779
|
-
|
|
816
|
+
run() {
|
|
780
817
|
if (!this.cancellablePromise) {
|
|
781
818
|
this.cancellablePromise = createCancelablePromise(token => this.doRun(token));
|
|
782
819
|
}
|
|
@@ -801,4 +838,4 @@ class AbstractExtensionTask {
|
|
|
801
838
|
}
|
|
802
839
|
}
|
|
803
840
|
|
|
804
|
-
export { AbstractExtensionManagementService, AbstractExtensionTask,
|
|
841
|
+
export { AbstractExtensionManagementService, AbstractExtensionTask, toExtensionManagementError };
|
package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js
CHANGED
|
@@ -2,7 +2,6 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { append, $, addDisposableListener, clearNode } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
3
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
4
4
|
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
5
|
-
import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
|
|
6
5
|
import { renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
7
6
|
import { Action, Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
8
7
|
import { isNonEmptyArray } from 'vscode/vscode/vs/base/common/arrays';
|
|
@@ -20,6 +19,7 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
|
|
|
20
19
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
21
20
|
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
|
|
22
21
|
import { ExtensionIdentifierMap } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
22
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
23
23
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
24
24
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
25
25
|
import { WorkbenchList } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
@@ -58,7 +58,7 @@ const _moduleId = "vs/workbench/contrib/extensions/browser/abstractRuntimeExtens
|
|
|
58
58
|
let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor extends EditorPane {
|
|
59
59
|
static { AbstractRuntimeExtensionsEditor_1 = this; }
|
|
60
60
|
static { this.ID = 'workbench.editor.runtimeExtensions'; }
|
|
61
|
-
constructor(group, telemetryService, themeService, contextKeyService, _extensionsWorkbenchService, _extensionService, _notificationService, _contextMenuService, _instantiationService, storageService, _labelService, _environmentService, _clipboardService, _extensionFeaturesManagementService) {
|
|
61
|
+
constructor(group, telemetryService, themeService, contextKeyService, _extensionsWorkbenchService, _extensionService, _notificationService, _contextMenuService, _instantiationService, storageService, _labelService, _environmentService, _clipboardService, _extensionFeaturesManagementService, _hoverService) {
|
|
62
62
|
super(AbstractRuntimeExtensionsEditor_1.ID, group, telemetryService, themeService, storageService);
|
|
63
63
|
this._extensionsWorkbenchService = _extensionsWorkbenchService;
|
|
64
64
|
this._extensionService = _extensionService;
|
|
@@ -69,6 +69,7 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
69
69
|
this._environmentService = _environmentService;
|
|
70
70
|
this._clipboardService = _clipboardService;
|
|
71
71
|
this._extensionFeaturesManagementService = _extensionFeaturesManagementService;
|
|
72
|
+
this._hoverService = _hoverService;
|
|
72
73
|
this._list = null;
|
|
73
74
|
this._elements = null;
|
|
74
75
|
this._updateSoon = this._register(( (new RunOnceScheduler(() => this._updateExtensions(), 200))));
|
|
@@ -287,12 +288,12 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
287
288
|
else {
|
|
288
289
|
title = ( localizeWithPath(_moduleId, 7, "Extension is activating..."));
|
|
289
290
|
}
|
|
290
|
-
data.elementDisposables.push(
|
|
291
|
+
data.elementDisposables.push(this._hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), data.activationTime, title));
|
|
291
292
|
clearNode(data.msgContainer);
|
|
292
293
|
if (this._getUnresponsiveProfile(element.description.identifier)) {
|
|
293
294
|
const el = $('span', undefined, ...renderLabelWithIcons(` $(alert) Unresponsive`));
|
|
294
295
|
const extensionHostFreezTitle = ( localizeWithPath(_moduleId, 8, "Extension has caused the extension host to freeze."));
|
|
295
|
-
data.elementDisposables.push(
|
|
296
|
+
data.elementDisposables.push(this._hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), el, extensionHostFreezTitle));
|
|
296
297
|
data.msgContainer.appendChild(el);
|
|
297
298
|
}
|
|
298
299
|
if (isNonEmptyArray(element.status.runtimeErrors)) {
|
|
@@ -334,22 +335,23 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
334
335
|
data.msgContainer.appendChild($('span', undefined, `${feature.label}: `));
|
|
335
336
|
data.msgContainer.appendChild($('span', undefined, ...renderLabelWithIcons(`$(${status.severity === Severity$1.Error ? errorIcon.id : warningIcon.id}) ${status.message}`)));
|
|
336
337
|
}
|
|
337
|
-
if (accessData?.
|
|
338
|
-
const element = $('span', undefined, ( localizeWithPath(
|
|
338
|
+
if (accessData?.totalCount > 0) {
|
|
339
|
+
const element = $('span', undefined, `${( localizeWithPath(
|
|
339
340
|
_moduleId,
|
|
340
341
|
10,
|
|
341
|
-
"{0} Requests: {1} (
|
|
342
|
+
"{0} Requests: {1} (Overall)",
|
|
342
343
|
feature.label,
|
|
343
|
-
accessData.current.count
|
|
344
|
-
)));
|
|
345
|
-
const title = ( localizeWithPath(
|
|
346
|
-
_moduleId,
|
|
347
|
-
11,
|
|
348
|
-
"Last request was {0}. Overall Requests: {1}",
|
|
349
|
-
fromNow(accessData.current.lastAccessed, true, true),
|
|
350
344
|
accessData.totalCount
|
|
351
|
-
));
|
|
352
|
-
|
|
345
|
+
))}${accessData.current ? ( localizeWithPath(_moduleId, 11, ", {0} (Session)", accessData.current.count)) : ''}`);
|
|
346
|
+
if (accessData.current) {
|
|
347
|
+
const title = ( localizeWithPath(
|
|
348
|
+
_moduleId,
|
|
349
|
+
12,
|
|
350
|
+
"Last request was {0}.",
|
|
351
|
+
fromNow(accessData.current.lastAccessed, true, true)
|
|
352
|
+
));
|
|
353
|
+
data.elementDisposables.push(this._hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), element, title));
|
|
354
|
+
}
|
|
353
355
|
data.msgContainer.appendChild(element);
|
|
354
356
|
}
|
|
355
357
|
}
|
|
@@ -374,7 +376,7 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
374
376
|
},
|
|
375
377
|
accessibilityProvider: new (class {
|
|
376
378
|
getWidgetAriaLabel() {
|
|
377
|
-
return ( localizeWithPath(_moduleId,
|
|
379
|
+
return ( localizeWithPath(_moduleId, 13, "Runtime Extensions"));
|
|
378
380
|
}
|
|
379
381
|
getAriaLabel(element) {
|
|
380
382
|
return element.description.name;
|
|
@@ -387,7 +389,7 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
387
389
|
return;
|
|
388
390
|
}
|
|
389
391
|
const actions = [];
|
|
390
|
-
actions.push(( (new Action('runtimeExtensionsEditor.action.copyId', ( localizeWithPath(_moduleId,
|
|
392
|
+
actions.push(( (new Action('runtimeExtensionsEditor.action.copyId', ( localizeWithPath(_moduleId, 14, "Copy id ({0})", e.element.description.identifier.value)), undefined, true, () => {
|
|
391
393
|
this._clipboardService.writeText(e.element.description.identifier.value);
|
|
392
394
|
}))));
|
|
393
395
|
const reportExtensionIssueAction = this._createReportExtensionIssueAction(e.element);
|
|
@@ -396,8 +398,8 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
396
398
|
}
|
|
397
399
|
actions.push(( (new Separator())));
|
|
398
400
|
if (e.element.marketplaceInfo) {
|
|
399
|
-
actions.push(( (new Action('runtimeExtensionsEditor.action.disableWorkspace', ( localizeWithPath(_moduleId,
|
|
400
|
-
actions.push(( (new Action('runtimeExtensionsEditor.action.disable', ( localizeWithPath(_moduleId,
|
|
401
|
+
actions.push(( (new Action('runtimeExtensionsEditor.action.disableWorkspace', ( localizeWithPath(_moduleId, 15, "Disable (Workspace)")), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element.marketplaceInfo, 7 )))));
|
|
402
|
+
actions.push(( (new Action('runtimeExtensionsEditor.action.disable', ( localizeWithPath(_moduleId, 16, "Disable")), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element.marketplaceInfo, 6 )))));
|
|
401
403
|
}
|
|
402
404
|
actions.push(( (new Separator())));
|
|
403
405
|
const profileAction = this._createProfileAction();
|
|
@@ -437,13 +439,14 @@ AbstractRuntimeExtensionsEditor = AbstractRuntimeExtensionsEditor_1 = ( (__decor
|
|
|
437
439
|
( (__param(10, ILabelService))),
|
|
438
440
|
( (__param(11, IWorkbenchEnvironmentService))),
|
|
439
441
|
( (__param(12, IClipboardService))),
|
|
440
|
-
( (__param(13, IExtensionFeaturesManagementService)))
|
|
442
|
+
( (__param(13, IExtensionFeaturesManagementService))),
|
|
443
|
+
( (__param(14, IHoverService)))
|
|
441
444
|
], AbstractRuntimeExtensionsEditor)));
|
|
442
445
|
class ShowRuntimeExtensionsAction extends Action2 {
|
|
443
446
|
constructor() {
|
|
444
447
|
super({
|
|
445
448
|
id: 'workbench.action.showRuntimeExtensions',
|
|
446
|
-
title: ( localize2WithPath(_moduleId,
|
|
449
|
+
title: ( localize2WithPath(_moduleId, 17, "Show Running Extensions")),
|
|
447
450
|
category: Categories.Developer,
|
|
448
451
|
f1: true,
|
|
449
452
|
menu: {
|
|
@@ -2,7 +2,6 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { append, $, addDisposableListener, setParentFlowTo } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
3
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
4
4
|
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
5
|
-
import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
|
|
6
5
|
import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
7
6
|
import { CheckboxActionViewItem } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
|
|
8
7
|
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
@@ -70,6 +69,7 @@ import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/p
|
|
|
70
69
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
71
70
|
import { VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
72
71
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
72
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
73
73
|
|
|
74
74
|
var ExtensionEditor_1;
|
|
75
75
|
const _moduleId = "vs/workbench/contrib/extensions/browser/extensionEditor";
|
|
@@ -127,10 +127,10 @@ class ExtensionWithDifferentGalleryVersionWidget extends ExtensionWidget {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
class VersionWidget extends ExtensionWithDifferentGalleryVersionWidget {
|
|
130
|
-
constructor(container) {
|
|
130
|
+
constructor(container, hoverService) {
|
|
131
131
|
super();
|
|
132
132
|
this.element = append(container, $('code.version'));
|
|
133
|
-
this._register(
|
|
133
|
+
this._register(hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), this.element, ( localizeWithPath(_moduleId, 0, "Extension Version"))));
|
|
134
134
|
this.render();
|
|
135
135
|
}
|
|
136
136
|
render() {
|
|
@@ -143,7 +143,7 @@ class VersionWidget extends ExtensionWithDifferentGalleryVersionWidget {
|
|
|
143
143
|
let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
144
144
|
static { ExtensionEditor_1 = this; }
|
|
145
145
|
static { this.ID = 'workbench.editor.extension'; }
|
|
146
|
-
constructor(group, telemetryService, instantiationService, paneCompositeService, extensionsWorkbenchService, extensionGalleryService, themeService, notificationService, openerService, extensionRecommendationsService, storageService, extensionService, webviewService, languageService, contextMenuService, contextKeyService, contextService, explorerService, viewsService, uriIdentityService) {
|
|
146
|
+
constructor(group, telemetryService, instantiationService, paneCompositeService, extensionsWorkbenchService, extensionGalleryService, themeService, notificationService, openerService, extensionRecommendationsService, storageService, extensionService, webviewService, languageService, contextMenuService, contextKeyService, contextService, explorerService, viewsService, uriIdentityService, hoverService) {
|
|
147
147
|
super(ExtensionEditor_1.ID, group, telemetryService, themeService, storageService);
|
|
148
148
|
this.instantiationService = instantiationService;
|
|
149
149
|
this.paneCompositeService = paneCompositeService;
|
|
@@ -161,6 +161,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
161
161
|
this.explorerService = explorerService;
|
|
162
162
|
this.viewsService = viewsService;
|
|
163
163
|
this.uriIdentityService = uriIdentityService;
|
|
164
|
+
this.hoverService = hoverService;
|
|
164
165
|
this._scopedContextKeyService = this._register(( (new MutableDisposable())));
|
|
165
166
|
this.initialScrollProgress = ( (new Map()));
|
|
166
167
|
this.currentIdentifier = '';
|
|
@@ -190,26 +191,26 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
190
191
|
const details = append(header, $('.details'));
|
|
191
192
|
const title = append(details, $('.title'));
|
|
192
193
|
const name = append(title, $('span.name.clickable', { role: 'heading', tabIndex: 0 }));
|
|
193
|
-
this._register(
|
|
194
|
-
const versionWidget = ( (new VersionWidget(title)));
|
|
194
|
+
this._register(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), name, ( localizeWithPath(_moduleId, 1, "Extension name"))));
|
|
195
|
+
const versionWidget = ( (new VersionWidget(title, this.hoverService)));
|
|
195
196
|
const preview = append(title, $('span.preview'));
|
|
196
|
-
this._register(
|
|
197
|
+
this._register(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), preview, ( localizeWithPath(_moduleId, 2, "Preview"))));
|
|
197
198
|
preview.textContent = ( localizeWithPath(_moduleId, 2, "Preview"));
|
|
198
199
|
const builtin = append(title, $('span.builtin'));
|
|
199
200
|
builtin.textContent = ( localizeWithPath(_moduleId, 3, "Built-in"));
|
|
200
201
|
const subtitle = append(details, $('.subtitle'));
|
|
201
202
|
const publisher = append(append(subtitle, $('.subtitle-entry')), $('.publisher.clickable', { tabIndex: 0 }));
|
|
202
|
-
this._register(
|
|
203
|
+
this._register(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), publisher, ( localizeWithPath(_moduleId, 4, "Publisher"))));
|
|
203
204
|
publisher.setAttribute('role', 'button');
|
|
204
205
|
const publisherDisplayName = append(publisher, $('.publisher-name'));
|
|
205
206
|
const verifiedPublisherWidget = this.instantiationService.createInstance(VerifiedPublisherWidget, append(publisher, $('.verified-publisher')), false);
|
|
206
207
|
const resource = append(append(subtitle, $('.subtitle-entry.resource')), $('', { tabIndex: 0 }));
|
|
207
208
|
resource.setAttribute('role', 'button');
|
|
208
209
|
const installCount = append(append(subtitle, $('.subtitle-entry')), $('span.install', { tabIndex: 0 }));
|
|
209
|
-
this._register(
|
|
210
|
+
this._register(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), installCount, ( localizeWithPath(_moduleId, 5, "Install count"))));
|
|
210
211
|
const installCountWidget = this.instantiationService.createInstance(InstallCountWidget, installCount, false);
|
|
211
212
|
const rating = append(append(subtitle, $('.subtitle-entry')), $('span.rating.clickable', { tabIndex: 0 }));
|
|
212
|
-
this._register(
|
|
213
|
+
this._register(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), rating, ( localizeWithPath(_moduleId, 6, "Rating"))));
|
|
213
214
|
rating.setAttribute('role', 'link');
|
|
214
215
|
const ratingsWidget = this.instantiationService.createInstance(RatingsWidget, rating, false);
|
|
215
216
|
const sponsorWidget = this.instantiationService.createInstance(SponsorWidget, append(subtitle, $('.subtitle-entry')));
|
|
@@ -432,7 +433,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
432
433
|
const workspaceFolder = this.contextService.getWorkspaceFolder(location);
|
|
433
434
|
if (workspaceFolder && extension.isWorkspaceScoped) {
|
|
434
435
|
template.resource.parentElement?.classList.add('clickable');
|
|
435
|
-
this.transientDisposables.add(
|
|
436
|
+
this.transientDisposables.add(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), template.resource, this.uriIdentityService.extUri.relativePath(workspaceFolder.uri, location)));
|
|
436
437
|
template.resource.textContent = ( localizeWithPath(_moduleId, 7, "Workspace Extension"));
|
|
437
438
|
this.transientDisposables.add(onClick(template.resource, () => {
|
|
438
439
|
this.viewsService.openView(VIEW_ID, true).then(() => this.explorerService.select(location, true));
|
|
@@ -440,7 +441,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
440
441
|
}
|
|
441
442
|
else {
|
|
442
443
|
template.resource.parentElement?.classList.remove('clickable');
|
|
443
|
-
this.transientDisposables.add(
|
|
444
|
+
this.transientDisposables.add(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), template.resource, location.path));
|
|
444
445
|
template.resource.textContent = ( localizeWithPath(_moduleId, 8, "Local Extension"));
|
|
445
446
|
}
|
|
446
447
|
}
|
|
@@ -806,7 +807,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
806
807
|
for (const [label, uri] of resources) {
|
|
807
808
|
const resource = append(resourcesElement, $('a.resource', { tabindex: '0' }, label));
|
|
808
809
|
this.transientDisposables.add(onClick(resource, () => this.openerService.open(uri)));
|
|
809
|
-
this.transientDisposables.add(
|
|
810
|
+
this.transientDisposables.add(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), resource, ( (uri.toString()))));
|
|
810
811
|
}
|
|
811
812
|
}
|
|
812
813
|
}
|
|
@@ -940,7 +941,8 @@ ExtensionEditor = ExtensionEditor_1 = ( (__decorate([
|
|
|
940
941
|
( (__param(16, IWorkspaceContextService))),
|
|
941
942
|
( (__param(17, IExplorerService))),
|
|
942
943
|
( (__param(18, IViewsService))),
|
|
943
|
-
( (__param(19, IUriIdentityService)))
|
|
944
|
+
( (__param(19, IUriIdentityService))),
|
|
945
|
+
( (__param(20, IHoverService)))
|
|
944
946
|
], ExtensionEditor)));
|
|
945
947
|
const contextKeyExpr = ( (ContextKeyExpr.and(
|
|
946
948
|
(ContextKeyExpr.equals('activeEditor', ExtensionEditor.ID)),
|