@codingame/monaco-vscode-extension-gallery-service-override 6.0.3 → 7.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 +22 -11
- package/vscode/src/vs/platform/extensionManagement/common/extensionGalleryService.js +42 -9
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementIpc.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +3 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +23 -21
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +11 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +170 -82
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsList.js +18 -34
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +6 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +10 -16
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +109 -58
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsWidgets.css.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +7 -2
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementChannelClient.js +2 -2
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.js +15 -6
- package/vscode/src/vs/workbench/services/extensionManagement/common/remoteExtensionManagementService.js +4 -4
- package/vscode/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extension-gallery-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.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@7.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js
CHANGED
|
@@ -13,6 +13,7 @@ import { isTargetPlatformCompatible, ExtensionManagementError, ExtensionManageme
|
|
|
13
13
|
import { IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
14
14
|
import { areSameExtensions, ExtensionKey, getGalleryExtensionId, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
15
15
|
import { isApplicationScopedExtension, ExtensionType } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
16
|
+
import { areApiProposalsCompatible } from 'vscode/vscode/vs/platform/extensions/common/extensionValidator';
|
|
16
17
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
17
18
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
18
19
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
@@ -92,7 +93,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
92
93
|
installableExtensions.push({ ...compatible, options });
|
|
93
94
|
}
|
|
94
95
|
catch (error) {
|
|
95
|
-
results.push({ identifier: extension.identifier, operation: InstallOperation.Install, source: extension, error });
|
|
96
|
+
results.push({ identifier: extension.identifier, operation: InstallOperation.Install, source: extension, error, profileLocation: options.profileLocation ?? this.getCurrentExtensionsManifestLocation() });
|
|
96
97
|
}
|
|
97
98
|
}))));
|
|
98
99
|
if (installableExtensions.length) {
|
|
@@ -117,7 +118,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
117
118
|
const existing = (await this.getInstalled(ExtensionType.User, profile.extensionsResource))
|
|
118
119
|
.find(e => areSameExtensions(e.identifier, extension.identifier));
|
|
119
120
|
if (existing) {
|
|
120
|
-
this._onDidUpdateExtensionMetadata.fire(existing);
|
|
121
|
+
this._onDidUpdateExtensionMetadata.fire({ local: existing, profileLocation: profile.extensionsResource });
|
|
121
122
|
}
|
|
122
123
|
else {
|
|
123
124
|
this._onDidUninstallExtension.fire({ identifier: extension.identifier, profileLocation: profile.extensionsResource });
|
|
@@ -154,7 +155,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
154
155
|
const key = `${getGalleryExtensionId(manifest.publisher, manifest.name)}-${( (options.profileLocation.toString()))}`;
|
|
155
156
|
installingExtensionsMap.set(key, { task: installExtensionTask, root });
|
|
156
157
|
this._onInstallExtension.fire({ identifier: installExtensionTask.identifier, source: extension, profileLocation: options.profileLocation });
|
|
157
|
-
this.logService.info('Installing extension:', installExtensionTask.identifier.id,
|
|
158
|
+
this.logService.info('Installing extension:', installExtensionTask.identifier.id, options);
|
|
158
159
|
if (!URI.isUri(extension)) {
|
|
159
160
|
this.installingExtensions.set(getInstallExtensionTaskKey(extension, options.profileLocation), { task: installExtensionTask, waitingTasks: [] });
|
|
160
161
|
}
|
|
@@ -489,17 +490,27 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
489
490
|
}
|
|
490
491
|
compatibleExtension = await this.getCompatibleVersion(extension, sameVersion, installPreRelease, productVersion);
|
|
491
492
|
if (!compatibleExtension) {
|
|
492
|
-
|
|
493
|
+
const incompatibleApiProposalsMessages = [];
|
|
494
|
+
if (!areApiProposalsCompatible(extension.properties.enabledApiProposals ?? [], incompatibleApiProposalsMessages)) {
|
|
493
495
|
throw ( (new ExtensionManagementError(localizeWithPath(
|
|
494
496
|
_moduleId,
|
|
495
497
|
4,
|
|
498
|
+
"Can't install '{0}' extension. {1}",
|
|
499
|
+
extension.displayName ?? extension.identifier.id,
|
|
500
|
+
incompatibleApiProposalsMessages[0]
|
|
501
|
+
), ExtensionManagementErrorCode.IncompatibleApi)));
|
|
502
|
+
}
|
|
503
|
+
if (!installPreRelease && extension.properties.isPreReleaseVersion && (await this.galleryService.getExtensions([extension.identifier], CancellationToken.None))[0]) {
|
|
504
|
+
throw ( (new ExtensionManagementError(localizeWithPath(
|
|
505
|
+
_moduleId,
|
|
506
|
+
5,
|
|
496
507
|
"Can't install release version of '{0}' extension because it has no release version.",
|
|
497
508
|
extension.displayName ?? extension.identifier.id
|
|
498
509
|
), ExtensionManagementErrorCode.ReleaseVersionNotFound)));
|
|
499
510
|
}
|
|
500
511
|
throw ( (new ExtensionManagementError(localizeWithPath(
|
|
501
512
|
_moduleId,
|
|
502
|
-
|
|
513
|
+
6,
|
|
503
514
|
"Can't install '{0}' extension because it is not compatible with the current version of {1} (version {2}).",
|
|
504
515
|
extension.identifier.id,
|
|
505
516
|
this.productService.nameLong,
|
|
@@ -673,7 +684,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
673
684
|
if (dependents.length === 1) {
|
|
674
685
|
return ( localizeWithPath(
|
|
675
686
|
_moduleId,
|
|
676
|
-
|
|
687
|
+
7,
|
|
677
688
|
"Cannot uninstall '{0}' extension. '{1}' extension depends on this.",
|
|
678
689
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
679
690
|
dependents[0].manifest.displayName || dependents[0].manifest.name
|
|
@@ -682,7 +693,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
682
693
|
if (dependents.length === 2) {
|
|
683
694
|
return ( localizeWithPath(
|
|
684
695
|
_moduleId,
|
|
685
|
-
|
|
696
|
+
8,
|
|
686
697
|
"Cannot uninstall '{0}' extension. '{1}' and '{2}' extensions depend on this.",
|
|
687
698
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
688
699
|
dependents[0].manifest.displayName || dependents[0].manifest.name,
|
|
@@ -691,7 +702,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
691
702
|
}
|
|
692
703
|
return ( localizeWithPath(
|
|
693
704
|
_moduleId,
|
|
694
|
-
|
|
705
|
+
9,
|
|
695
706
|
"Cannot uninstall '{0}' extension. '{1}', '{2}' and other extension depend on this.",
|
|
696
707
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
697
708
|
dependents[0].manifest.displayName || dependents[0].manifest.name,
|
|
@@ -701,7 +712,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
701
712
|
if (dependents.length === 1) {
|
|
702
713
|
return ( localizeWithPath(
|
|
703
714
|
_moduleId,
|
|
704
|
-
|
|
715
|
+
10,
|
|
705
716
|
"Cannot uninstall '{0}' extension . It includes uninstalling '{1}' extension and '{2}' extension depends on this.",
|
|
706
717
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
707
718
|
dependingExtension.manifest.displayName
|
|
@@ -712,7 +723,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
712
723
|
if (dependents.length === 2) {
|
|
713
724
|
return ( localizeWithPath(
|
|
714
725
|
_moduleId,
|
|
715
|
-
|
|
726
|
+
11,
|
|
716
727
|
"Cannot uninstall '{0}' extension. It includes uninstalling '{1}' extension and '{2}' and '{3}' extensions depend on this.",
|
|
717
728
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
718
729
|
dependingExtension.manifest.displayName
|
|
@@ -723,7 +734,7 @@ let AbstractExtensionManagementService = class AbstractExtensionManagementServic
|
|
|
723
734
|
}
|
|
724
735
|
return ( localizeWithPath(
|
|
725
736
|
_moduleId,
|
|
726
|
-
|
|
737
|
+
12,
|
|
727
738
|
"Cannot uninstall '{0}' extension. It includes uninstalling '{1}' extension and '{2}', '{3}' and other extensions depend on this.",
|
|
728
739
|
extensionToUninstall.manifest.displayName || extensionToUninstall.manifest.name,
|
|
729
740
|
dependingExtension.manifest.displayName
|
|
@@ -11,7 +11,7 @@ import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/commo
|
|
|
11
11
|
import { getTargetPlatform, SortBy, SortOrder, toTargetPlatform, WEB_EXTENSION_TAG, isNotWebExtensionInWebTargetPlatform, isTargetPlatformCompatible, ExtensionGalleryErrorCode, ExtensionGalleryError, StatisticType, InstallOperation } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
12
12
|
import { adoptToGalleryExtensionId, getGalleryExtensionId, areSameExtensions, getGalleryExtensionTelemetryData } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
13
13
|
import { TargetPlatform } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
14
|
-
import { isEngineValid } from 'vscode/vscode/vs/platform/extensions/common/extensionValidator';
|
|
14
|
+
import { isEngineValid, areApiProposalsCompatible } from 'vscode/vscode/vs/platform/extensions/common/extensionValidator';
|
|
15
15
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
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';
|
|
@@ -69,6 +69,7 @@ const PropertyType = {
|
|
|
69
69
|
ExtensionPack: 'Microsoft.VisualStudio.Code.ExtensionPack',
|
|
70
70
|
Engine: 'Microsoft.VisualStudio.Code.Engine',
|
|
71
71
|
PreRelease: 'Microsoft.VisualStudio.Code.PreRelease',
|
|
72
|
+
EnabledApiProposals: 'Microsoft.VisualStudio.Code.EnabledApiProposals',
|
|
72
73
|
LocalizedLanguages: 'Microsoft.VisualStudio.Code.LocalizedLanguages',
|
|
73
74
|
WebExtension: 'Microsoft.VisualStudio.Code.WebExtension',
|
|
74
75
|
SponsorLink: 'Microsoft.VisualStudio.Code.SponsorLink',
|
|
@@ -190,6 +191,11 @@ function isPreReleaseVersion(version) {
|
|
|
190
191
|
const values = version.properties ? version.properties.filter(p => p.key === PropertyType.PreRelease) : [];
|
|
191
192
|
return values.length > 0 && values[0].value === 'true';
|
|
192
193
|
}
|
|
194
|
+
function getEnabledApiProposals(version) {
|
|
195
|
+
const values = version.properties ? version.properties.filter(p => p.key === PropertyType.EnabledApiProposals) : [];
|
|
196
|
+
const value = (values.length > 0 && values[0].value) || '';
|
|
197
|
+
return value ? value.split(',') : [];
|
|
198
|
+
}
|
|
193
199
|
function getLocalizedLanguages(version) {
|
|
194
200
|
const values = version.properties ? version.properties.filter(p => p.key === PropertyType.LocalizedLanguages) : [];
|
|
195
201
|
const value = (values.length > 0 && values[0].value) || '';
|
|
@@ -286,6 +292,7 @@ function toExtension(galleryExtension, version, allTargetPlatforms, queryContext
|
|
|
286
292
|
dependencies: getExtensions(version, PropertyType.Dependency),
|
|
287
293
|
extensionPack: getExtensions(version, PropertyType.ExtensionPack),
|
|
288
294
|
engine: getEngine(version),
|
|
295
|
+
enabledApiProposals: getEnabledApiProposals(version),
|
|
289
296
|
localizedLanguages: getLocalizedLanguages(version),
|
|
290
297
|
targetPlatform: getTargetPlatformForExtensionVersion(version),
|
|
291
298
|
isPreReleaseVersion: isPreReleaseVersion(version)
|
|
@@ -312,6 +319,7 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
312
319
|
this.extensionsGalleryUrl = isPPEEnabled ? config.servicePPEUrl : config?.serviceUrl;
|
|
313
320
|
this.extensionsGallerySearchUrl = isPPEEnabled ? undefined : config?.searchUrl;
|
|
314
321
|
this.extensionsControlUrl = config?.controlUrl;
|
|
322
|
+
this.extensionsEnabledWithApiProposalVersion = productService.extensionsEnabledWithApiProposalVersion?.map(id => id.toLowerCase()) ?? [];
|
|
315
323
|
this.commonHeadersPromise = resolveMarketplaceHeaders(productService.version, productService, this.environmentService, this.configurationService, this.fileService, storageService, this.telemetryService);
|
|
316
324
|
}
|
|
317
325
|
api(path = '') {
|
|
@@ -391,7 +399,22 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
391
399
|
}
|
|
392
400
|
engine = manifest.engines.vscode;
|
|
393
401
|
}
|
|
394
|
-
|
|
402
|
+
if (!isEngineValid(engine, productVersion.version, productVersion.date)) {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
if (!this.areApiProposalsCompatible(extension.identifier, extension.properties.enabledApiProposals)) {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
areApiProposalsCompatible(extensionIdentifier, enabledApiProposals) {
|
|
411
|
+
if (!enabledApiProposals) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
if (!this.extensionsEnabledWithApiProposalVersion.includes(extensionIdentifier.id.toLowerCase())) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
return areApiProposalsCompatible(enabledApiProposals);
|
|
395
418
|
}
|
|
396
419
|
async isValidVersion(extension, rawGalleryExtensionVersion, versionType, compatible, allTargetPlatforms, targetPlatform, productVersion = { version: this.productService.version, date: this.productService.date }) {
|
|
397
420
|
if (!isTargetPlatformCompatible(getTargetPlatformForExtensionVersion(rawGalleryExtensionVersion), allTargetPlatforms, targetPlatform)) {
|
|
@@ -547,7 +570,10 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
547
570
|
if (version && rawGalleryExtensionVersion.version !== version) {
|
|
548
571
|
continue;
|
|
549
572
|
}
|
|
550
|
-
if (await this.isValidVersion(
|
|
573
|
+
if (await this.isValidVersion(extensionIdentifier.id, rawGalleryExtensionVersion, includePreRelease ? 'any' : 'release', criteria.compatible, allTargetPlatforms, criteria.targetPlatform, criteria.productVersion)) {
|
|
574
|
+
if (criteria.compatible && !this.areApiProposalsCompatible(extensionIdentifier, getEnabledApiProposals(rawGalleryExtensionVersion))) {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
551
577
|
return toExtension(rawGalleryExtension, rawGalleryExtensionVersion, allTargetPlatforms, queryContext);
|
|
552
578
|
}
|
|
553
579
|
if (version && rawGalleryExtensionVersion.version === version) {
|
|
@@ -731,15 +757,15 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
731
757
|
}
|
|
732
758
|
return '';
|
|
733
759
|
}
|
|
734
|
-
async getAllCompatibleVersions(
|
|
760
|
+
async getAllCompatibleVersions(extensionIdentifier, includePreRelease, targetPlatform) {
|
|
735
761
|
let query = ( new Query())
|
|
736
762
|
.withFlags(Flags.IncludeVersions, Flags.IncludeCategoryAndTags, Flags.IncludeFiles, Flags.IncludeVersionProperties)
|
|
737
763
|
.withPage(1, 1);
|
|
738
|
-
if (
|
|
739
|
-
query = query.withFilter(FilterType.ExtensionId,
|
|
764
|
+
if (extensionIdentifier.uuid) {
|
|
765
|
+
query = query.withFilter(FilterType.ExtensionId, extensionIdentifier.uuid);
|
|
740
766
|
}
|
|
741
767
|
else {
|
|
742
|
-
query = query.withFilter(FilterType.ExtensionName,
|
|
768
|
+
query = query.withFilter(FilterType.ExtensionName, extensionIdentifier.id);
|
|
743
769
|
}
|
|
744
770
|
const { galleryExtensions } = await this.queryRawGalleryExtensions(query, CancellationToken.None);
|
|
745
771
|
if (!galleryExtensions.length) {
|
|
@@ -752,7 +778,8 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
752
778
|
const validVersions = [];
|
|
753
779
|
await Promise.all(( galleryExtensions[0].versions.map(async (version) => {
|
|
754
780
|
try {
|
|
755
|
-
if (await this.isValidVersion(
|
|
781
|
+
if ((await this.isValidVersion(extensionIdentifier.id, version, includePreRelease ? 'any' : 'release', true, allTargetPlatforms, targetPlatform))
|
|
782
|
+
&& this.areApiProposalsCompatible(extensionIdentifier, getEnabledApiProposals(version))) {
|
|
756
783
|
validVersions.push(version);
|
|
757
784
|
}
|
|
758
785
|
}
|
|
@@ -821,6 +848,7 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
821
848
|
const malicious = [];
|
|
822
849
|
const deprecated = {};
|
|
823
850
|
const search = [];
|
|
851
|
+
const extensionsEnabledWithPreRelease = [];
|
|
824
852
|
if (result) {
|
|
825
853
|
for (const id of result.malicious) {
|
|
826
854
|
malicious.push({ id });
|
|
@@ -852,8 +880,13 @@ let AbstractExtensionGalleryService = class AbstractExtensionGalleryService {
|
|
|
852
880
|
search.push(s);
|
|
853
881
|
}
|
|
854
882
|
}
|
|
883
|
+
if (Array.isArray(result.extensionsEnabledWithPreRelease)) {
|
|
884
|
+
for (const id of result.extensionsEnabledWithPreRelease) {
|
|
885
|
+
extensionsEnabledWithPreRelease.push(id.toLowerCase());
|
|
886
|
+
}
|
|
887
|
+
}
|
|
855
888
|
}
|
|
856
|
-
return { malicious, deprecated, search };
|
|
889
|
+
return { malicious, deprecated, search, extensionsEnabledWithPreRelease };
|
|
857
890
|
}
|
|
858
891
|
};
|
|
859
892
|
AbstractExtensionGalleryService = ( __decorate([
|
|
@@ -30,7 +30,7 @@ class ExtensionManagementChannelClient extends Disposable {
|
|
|
30
30
|
)))));
|
|
31
31
|
this._register(this.channel.listen('onUninstallExtension')(e => this.fireEvent(this._onUninstallExtension, { ...e, profileLocation: URI.revive(e.profileLocation) })));
|
|
32
32
|
this._register(this.channel.listen('onDidUninstallExtension')(e => this.fireEvent(this._onDidUninstallExtension, { ...e, profileLocation: URI.revive(e.profileLocation) })));
|
|
33
|
-
this._register(this.channel.listen('onDidUpdateExtensionMetadata')(e => this._onDidUpdateExtensionMetadata.
|
|
33
|
+
this._register(this.channel.listen('onDidUpdateExtensionMetadata')(e => this.fireEvent(this._onDidUpdateExtensionMetadata, { profileLocation: URI.revive(e.profileLocation), local: transformIncomingExtension(e.local, null) })));
|
|
34
34
|
}
|
|
35
35
|
fireEvent(event, data) {
|
|
36
36
|
event.fire(data);
|
package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js
CHANGED
|
@@ -288,12 +288,12 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
288
288
|
else {
|
|
289
289
|
title = ( localizeWithPath(_moduleId, 7, "Extension is activating..."));
|
|
290
290
|
}
|
|
291
|
-
data.elementDisposables.push(this._hoverService.
|
|
291
|
+
data.elementDisposables.push(this._hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), data.activationTime, title));
|
|
292
292
|
clearNode(data.msgContainer);
|
|
293
293
|
if (this._getUnresponsiveProfile(element.description.identifier)) {
|
|
294
294
|
const el = $('span', undefined, ...renderLabelWithIcons(` $(alert) Unresponsive`));
|
|
295
295
|
const extensionHostFreezTitle = ( localizeWithPath(_moduleId, 8, "Extension has caused the extension host to freeze."));
|
|
296
|
-
data.elementDisposables.push(this._hoverService.
|
|
296
|
+
data.elementDisposables.push(this._hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), el, extensionHostFreezTitle));
|
|
297
297
|
data.msgContainer.appendChild(el);
|
|
298
298
|
}
|
|
299
299
|
if (isNonEmptyArray(element.status.runtimeErrors)) {
|
|
@@ -350,7 +350,7 @@ let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor exte
|
|
|
350
350
|
"Last request was {0}.",
|
|
351
351
|
fromNow(accessData.current.lastAccessed, true, true)
|
|
352
352
|
));
|
|
353
|
-
data.elementDisposables.push(this._hoverService.
|
|
353
|
+
data.elementDisposables.push(this._hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), element, title));
|
|
354
354
|
}
|
|
355
355
|
data.msgContainer.appendChild(element);
|
|
356
356
|
}
|
|
@@ -55,7 +55,7 @@ import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/co
|
|
|
55
55
|
import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
56
56
|
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
57
57
|
import { ExtensionFeaturesTab } from './extensionFeaturesTab.js';
|
|
58
|
-
import { InstallDropdownAction, ExtensionRuntimeStateAction, ExtensionStatusLabelAction,
|
|
58
|
+
import { InstallDropdownAction, ExtensionRuntimeStateAction, ExtensionStatusLabelAction, ButtonWithDropDownExtensionAction, ExtensionAction, UpdateAction, ToggleAutoUpdateForExtensionAction, SetColorThemeAction, SetFileIconThemeAction, SetProductIconThemeAction, SetLanguageAction, ClearLanguageAction, EnableDropDownAction, DisableDropDownAction, RemoteInstallAction, LocalInstallAction, WebInstallAction, InstallingLabelAction, UninstallAction, MigrateDeprecatedExtensionAction, InstallAnotherVersionAction, TogglePreReleaseExtensionAction, ExtensionEditorManageExtensionAction, DropDownExtensionAction, ButtonWithDropdownExtensionActionViewItem, ExtensionStatusAction } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
|
|
59
59
|
import { Delegate } from './extensionsList.js';
|
|
60
60
|
import { ExtensionsTree, ExtensionData, ExtensionsGridView, getExtensions } from './extensionsViewer.js';
|
|
61
61
|
import { ExtensionWidget, RemoteBadgeWidget, VerifiedPublisherWidget, InstallCountWidget, RatingsWidget, SponsorWidget, ExtensionStatusWidget, ExtensionRecommendationWidget, onClick } from './extensionsWidgets.js';
|
|
@@ -138,7 +138,7 @@ class VersionWidget extends ExtensionWithDifferentGalleryVersionWidget {
|
|
|
138
138
|
constructor(container, hoverService) {
|
|
139
139
|
super();
|
|
140
140
|
this.element = append(container, $('code.version'));
|
|
141
|
-
this._register(hoverService.
|
|
141
|
+
this._register(hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), this.element, ( localizeWithPath(_moduleId, 0, "Extension Version"))));
|
|
142
142
|
this.render();
|
|
143
143
|
}
|
|
144
144
|
render() {
|
|
@@ -199,26 +199,26 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
199
199
|
const details = append(header, $('.details'));
|
|
200
200
|
const title = append(details, $('.title'));
|
|
201
201
|
const name = append(title, $('span.name.clickable', { role: 'heading', tabIndex: 0 }));
|
|
202
|
-
this._register(this.hoverService.
|
|
202
|
+
this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), name, ( localizeWithPath(_moduleId, 1, "Extension name"))));
|
|
203
203
|
const versionWidget = ( (new VersionWidget(title, this.hoverService)));
|
|
204
204
|
const preview = append(title, $('span.preview'));
|
|
205
|
-
this._register(this.hoverService.
|
|
205
|
+
this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), preview, ( localizeWithPath(_moduleId, 2, "Preview"))));
|
|
206
206
|
preview.textContent = ( localizeWithPath(_moduleId, 2, "Preview"));
|
|
207
207
|
const builtin = append(title, $('span.builtin'));
|
|
208
208
|
builtin.textContent = ( localizeWithPath(_moduleId, 3, "Built-in"));
|
|
209
209
|
const subtitle = append(details, $('.subtitle'));
|
|
210
210
|
const publisher = append(append(subtitle, $('.subtitle-entry')), $('.publisher.clickable', { tabIndex: 0 }));
|
|
211
|
-
this._register(this.hoverService.
|
|
211
|
+
this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), publisher, ( localizeWithPath(_moduleId, 4, "Publisher"))));
|
|
212
212
|
publisher.setAttribute('role', 'button');
|
|
213
213
|
const publisherDisplayName = append(publisher, $('.publisher-name'));
|
|
214
214
|
const verifiedPublisherWidget = this.instantiationService.createInstance(VerifiedPublisherWidget, append(publisher, $('.verified-publisher')), false);
|
|
215
215
|
const resource = append(append(subtitle, $('.subtitle-entry.resource')), $('', { tabIndex: 0 }));
|
|
216
216
|
resource.setAttribute('role', 'button');
|
|
217
217
|
const installCount = append(append(subtitle, $('.subtitle-entry')), $('span.install', { tabIndex: 0 }));
|
|
218
|
-
this._register(this.hoverService.
|
|
218
|
+
this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), installCount, ( localizeWithPath(_moduleId, 5, "Install count"))));
|
|
219
219
|
const installCountWidget = this.instantiationService.createInstance(InstallCountWidget, installCount, false);
|
|
220
220
|
const rating = append(append(subtitle, $('.subtitle-entry')), $('span.rating.clickable', { tabIndex: 0 }));
|
|
221
|
-
this._register(this.hoverService.
|
|
221
|
+
this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), rating, ( localizeWithPath(_moduleId, 6, "Rating"))));
|
|
222
222
|
rating.setAttribute('role', 'link');
|
|
223
223
|
const ratingsWidget = this.instantiationService.createInstance(RatingsWidget, rating, false);
|
|
224
224
|
const sponsorWidget = this.instantiationService.createInstance(SponsorWidget, append(subtitle, $('.subtitle-entry')));
|
|
@@ -235,7 +235,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
235
235
|
const actions = [
|
|
236
236
|
this.instantiationService.createInstance(ExtensionRuntimeStateAction),
|
|
237
237
|
this.instantiationService.createInstance(ExtensionStatusLabelAction),
|
|
238
|
-
this.instantiationService.createInstance(
|
|
238
|
+
this.instantiationService.createInstance(ButtonWithDropDownExtensionAction, 'extensions.updateActions', ExtensionAction.PROMINENT_LABEL_ACTION_CLASS, [[this.instantiationService.createInstance(UpdateAction, true)], [this.instantiationService.createInstance(ToggleAutoUpdateForExtensionAction, true, [true, 'onlyEnabledExtensions'])]]),
|
|
239
239
|
this.instantiationService.createInstance(SetColorThemeAction),
|
|
240
240
|
this.instantiationService.createInstance(SetFileIconThemeAction),
|
|
241
241
|
this.instantiationService.createInstance(SetProductIconThemeAction),
|
|
@@ -248,11 +248,11 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
248
248
|
this.instantiationService.createInstance(WebInstallAction),
|
|
249
249
|
installAction,
|
|
250
250
|
this.instantiationService.createInstance(InstallingLabelAction),
|
|
251
|
-
this.instantiationService.createInstance(
|
|
251
|
+
this.instantiationService.createInstance(ButtonWithDropDownExtensionAction, 'extensions.uninstall', UninstallAction.UninstallClass, [
|
|
252
252
|
[
|
|
253
253
|
this.instantiationService.createInstance(MigrateDeprecatedExtensionAction, false),
|
|
254
254
|
this.instantiationService.createInstance(UninstallAction),
|
|
255
|
-
this.instantiationService.createInstance(InstallAnotherVersionAction),
|
|
255
|
+
this.instantiationService.createInstance(InstallAnotherVersionAction, null, true),
|
|
256
256
|
]
|
|
257
257
|
]),
|
|
258
258
|
this.instantiationService.createInstance(TogglePreReleaseExtensionAction),
|
|
@@ -265,16 +265,18 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
265
265
|
const actionsAndStatusContainer = append(details, $('.actions-status-container'));
|
|
266
266
|
const extensionActionBar = this._register(( (new ActionBar(actionsAndStatusContainer, {
|
|
267
267
|
actionViewItemProvider: (action, options) => {
|
|
268
|
-
if (action instanceof
|
|
268
|
+
if (action instanceof DropDownExtensionAction) {
|
|
269
269
|
return action.createActionViewItem(options);
|
|
270
270
|
}
|
|
271
|
-
if (action instanceof
|
|
271
|
+
if (action instanceof ButtonWithDropDownExtensionAction) {
|
|
272
272
|
return (
|
|
273
|
-
(new
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
273
|
+
(new ButtonWithDropdownExtensionActionViewItem(action, {
|
|
274
|
+
...options,
|
|
275
|
+
icon: true,
|
|
276
|
+
label: true,
|
|
277
|
+
menuActionsOrProvider: { getActions: () => action.menuActions },
|
|
278
|
+
menuActionClassNames: action.menuActionClassNames
|
|
279
|
+
}, this.contextMenuService))
|
|
278
280
|
);
|
|
279
281
|
}
|
|
280
282
|
if (action instanceof ToggleAutoUpdateForExtensionAction) {
|
|
@@ -441,7 +443,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
441
443
|
const workspaceFolder = this.contextService.getWorkspaceFolder(location);
|
|
442
444
|
if (workspaceFolder && extension.isWorkspaceScoped) {
|
|
443
445
|
template.resource.parentElement?.classList.add('clickable');
|
|
444
|
-
this.transientDisposables.add(this.hoverService.
|
|
446
|
+
this.transientDisposables.add(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), template.resource, this.uriIdentityService.extUri.relativePath(workspaceFolder.uri, location)));
|
|
445
447
|
template.resource.textContent = ( localizeWithPath(_moduleId, 7, "Workspace Extension"));
|
|
446
448
|
this.transientDisposables.add(onClick(template.resource, () => {
|
|
447
449
|
this.viewsService.openView(VIEW_ID, true).then(() => this.explorerService.select(location, true));
|
|
@@ -449,7 +451,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
449
451
|
}
|
|
450
452
|
else {
|
|
451
453
|
template.resource.parentElement?.classList.remove('clickable');
|
|
452
|
-
this.transientDisposables.add(this.hoverService.
|
|
454
|
+
this.transientDisposables.add(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), template.resource, location.path));
|
|
453
455
|
template.resource.textContent = ( localizeWithPath(_moduleId, 8, "Local Extension"));
|
|
454
456
|
}
|
|
455
457
|
}
|
|
@@ -632,7 +634,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
632
634
|
if (token?.isCancellationRequested) {
|
|
633
635
|
return '';
|
|
634
636
|
}
|
|
635
|
-
const content = await renderMarkdownDocument(contents, this.extensionService, this.languageService, extension.type !== ExtensionType.System,
|
|
637
|
+
const content = await renderMarkdownDocument(contents, this.extensionService, this.languageService, { shouldSanitize: extension.type !== ExtensionType.System, token });
|
|
636
638
|
if (token?.isCancellationRequested) {
|
|
637
639
|
return '';
|
|
638
640
|
}
|
|
@@ -815,7 +817,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
815
817
|
for (const [label, uri] of resources) {
|
|
816
818
|
const resource = append(resourcesElement, $('a.resource', { tabindex: '0' }, label));
|
|
817
819
|
this.transientDisposables.add(onClick(resource, () => this.openerService.open(uri)));
|
|
818
|
-
this.transientDisposables.add(this.hoverService.
|
|
820
|
+
this.transientDisposables.add(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), resource, ( (uri.toString()))));
|
|
819
821
|
}
|
|
820
822
|
}
|
|
821
823
|
}
|
|
@@ -226,11 +226,21 @@ let ExtensionRecommendationNotificationService = class ExtensionRecommendationNo
|
|
|
226
226
|
const installExtensions = async (isMachineScoped) => {
|
|
227
227
|
this.runAction(this.instantiationService.createInstance(SearchExtensionsAction, searchValue));
|
|
228
228
|
onDidInstallRecommendedExtensions(extensions);
|
|
229
|
+
const galleryExtensions = [], resourceExtensions = [];
|
|
230
|
+
for (const extension of extensions) {
|
|
231
|
+
if (extension.gallery) {
|
|
232
|
+
galleryExtensions.push(extension.gallery);
|
|
233
|
+
}
|
|
234
|
+
else if (extension.resourceExtension) {
|
|
235
|
+
resourceExtensions.push(extension);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
229
238
|
await Promises.settled([
|
|
230
239
|
Promises.settled(( (extensions.map(
|
|
231
240
|
extension => this.extensionsWorkbenchService.open(extension, { pinned: true })
|
|
232
241
|
)))),
|
|
233
|
-
this.extensionManagementService.installGalleryExtensions(( (
|
|
242
|
+
galleryExtensions.length ? this.extensionManagementService.installGalleryExtensions(( (galleryExtensions.map(e => ({ extension: e, options: { isMachineScoped } }))))) : Promise.resolve(),
|
|
243
|
+
resourceExtensions.length ? Promise.allSettled(( (resourceExtensions.map(r => this.extensionsWorkbenchService.install(r))))) : Promise.resolve()
|
|
234
244
|
]);
|
|
235
245
|
};
|
|
236
246
|
choices.push({
|