@codingame/monaco-vscode-extension-gallery-service-override 2.1.4 → 2.2.0-next.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.
- package/assets/theme-icon.png +0 -0
- package/extensionGallery.js +10 -3
- package/package.json +10 -3
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/update/common/update.js +0 -3
- package/vscode/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.js +0 -85
|
Binary file
|
package/extensionGallery.js
CHANGED
|
@@ -14,7 +14,6 @@ import { IExtensionRecommendationNotificationService } from 'vscode/vscode/vs/pl
|
|
|
14
14
|
import { IIgnoredExtensionsManagementService, IgnoredExtensionsManagementService } from 'vscode/vscode/vs/platform/userDataSync/common/ignoredExtensions';
|
|
15
15
|
import { IExtensionManifestPropertiesService, ExtensionManifestPropertiesService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService';
|
|
16
16
|
import { IBuiltinExtensionsScannerService } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
17
|
-
import { BuiltinExtensionsScannerService } from './vscode/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.js';
|
|
18
17
|
import { ExtensionIgnoredRecommendationsService } from './vscode/src/vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService.js';
|
|
19
18
|
import { IWorkspaceExtensionsConfigService, WorkspaceExtensionsConfigService } from 'vscode/vscode/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig';
|
|
20
19
|
import { ExtensionRecommendationNotificationService } from './vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js';
|
|
@@ -29,9 +28,12 @@ import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/
|
|
|
29
28
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
30
29
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
31
30
|
import { registerAssets } from 'vscode/assets';
|
|
31
|
+
import { getExtensionManifests } from 'vscode/extensions';
|
|
32
32
|
|
|
33
33
|
registerAssets({
|
|
34
|
-
'vs/workbench/services/extensionManagement/common/media/defaultIcon.png': ( new URL('./assets/defaultIcon.png', import.meta.url).toString())
|
|
34
|
+
'vs/workbench/services/extensionManagement/common/media/defaultIcon.png': ( new URL('./assets/defaultIcon.png', import.meta.url).toString()),
|
|
35
|
+
'vs/workbench/contrib/extensions/browser/media/theme-icon.png': new URL('./assets/theme-icon.png', import.meta.url).href,
|
|
36
|
+
'vs/workbench/contrib/extensions/browser/media/language-icon.svg': new URL('./assets/theme-icon.png', import.meta.url).href
|
|
35
37
|
});
|
|
36
38
|
let ExtensionManagementServerServiceOverride = class ExtensionManagementServerServiceOverride extends ExtensionManagementServerService {
|
|
37
39
|
constructor(isWebOnly, remoteAgentService, labelService, instantiationService) {
|
|
@@ -50,6 +52,11 @@ ExtensionManagementServerServiceOverride = __decorate([
|
|
|
50
52
|
( __param(2, ILabelService)),
|
|
51
53
|
( __param(3, IInstantiationService))
|
|
52
54
|
], ExtensionManagementServerServiceOverride);
|
|
55
|
+
class CustomBuiltinExtensionsScannerService {
|
|
56
|
+
async scanBuiltinExtensions() {
|
|
57
|
+
return getExtensionManifests();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
53
60
|
function getServiceOverride(options = { webOnly: false }) {
|
|
54
61
|
return {
|
|
55
62
|
[( IExtensionGalleryService.toString())]: new SyncDescriptor(ExtensionGalleryService, [], true),
|
|
@@ -63,7 +70,7 @@ function getServiceOverride(options = { webOnly: false }) {
|
|
|
63
70
|
[( IIgnoredExtensionsManagementService.toString())]: new SyncDescriptor(IgnoredExtensionsManagementService, [], true),
|
|
64
71
|
[( IExtensionManifestPropertiesService.toString())]: new SyncDescriptor(ExtensionManifestPropertiesService, [], true),
|
|
65
72
|
[( IExtensionManagementService.toString())]: new SyncDescriptor(ExtensionManagementService, [], true),
|
|
66
|
-
[( IBuiltinExtensionsScannerService.toString())]: new SyncDescriptor(
|
|
73
|
+
[( IBuiltinExtensionsScannerService.toString())]: new SyncDescriptor(CustomBuiltinExtensionsScannerService, [], true),
|
|
67
74
|
[( IWorkspaceExtensionsConfigService.toString())]: new SyncDescriptor(WorkspaceExtensionsConfigService, [], true),
|
|
68
75
|
[( IExtensionTipsService.toString())]: new SyncDescriptor(ExtensionTipsService, [], true),
|
|
69
76
|
[( IRemoteUserDataProfilesService.toString())]: new SyncDescriptor(RemoteUserDataProfilesService, [], true),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extension-gallery-service-override",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-next.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,8 +18,15 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@2.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.2.0-next.2",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"vscode-semver": "npm:semver@=5.5.0"
|
|
23
|
+
"vscode-semver": "npm:semver@=5.5.0",
|
|
24
|
+
"@codingame/monaco-vscode-files-service-override": "2.2.0-next.2",
|
|
25
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "2.2.0-next.2",
|
|
26
|
+
"@codingame/monaco-vscode-extensions-service-override": "2.2.0-next.2",
|
|
27
|
+
"@codingame/monaco-vscode-environment-service-override": "2.2.0-next.2",
|
|
28
|
+
"@codingame/monaco-vscode-layout-service-override": "2.2.0-next.2",
|
|
29
|
+
"@codingame/monaco-vscode-host-service-override": "2.2.0-next.2",
|
|
30
|
+
"@codingame/monaco-vscode-base-service-override": "2.2.0-next.2"
|
|
24
31
|
}
|
|
25
32
|
}
|
|
@@ -51,7 +51,7 @@ import { ExtensionsTree, ExtensionData, ExtensionsGridView, getExtensions } from
|
|
|
51
51
|
import { RemoteBadgeWidget, VerifiedPublisherWidget, InstallCountWidget, RatingsWidget, SponsorWidget, ExtensionStatusWidget, ExtensionWidget, ExtensionRecommendationWidget, onClick } from './extensionsWidgets.js';
|
|
52
52
|
import { ExtensionContainers, VIEWLET_ID, IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
53
53
|
import { renderMarkdownDocument, DEFAULT_MARKDOWN_STYLES } from 'vscode/vscode/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer';
|
|
54
|
-
import { ShowCurrentReleaseNotesActionId } from '
|
|
54
|
+
import { ShowCurrentReleaseNotesActionId } from 'vscode/vscode/vs/workbench/contrib/update/common/update';
|
|
55
55
|
import { KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_FOCUSED, IWebviewService } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webview';
|
|
56
56
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
57
57
|
import { IExtensionRecommendationsService } from 'vscode/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations';
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { isWeb, Language } from 'vscode/vscode/vs/base/common/platform';
|
|
3
|
-
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
4
|
-
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
5
|
-
import { getGalleryExtensionId } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
6
|
-
import { FileAccess, builtinExtensionsPath } from 'vscode/vscode/vs/base/common/network';
|
|
7
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
8
|
-
import { IExtensionResourceLoaderService } from 'vscode/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader';
|
|
9
|
-
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
|
|
10
|
-
import { localizeManifest } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionNls';
|
|
11
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
12
|
-
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
13
|
-
|
|
14
|
-
let BuiltinExtensionsScannerService = class BuiltinExtensionsScannerService {
|
|
15
|
-
constructor(environmentService, uriIdentityService, extensionResourceLoaderService, productService, logService) {
|
|
16
|
-
this.extensionResourceLoaderService = extensionResourceLoaderService;
|
|
17
|
-
this.logService = logService;
|
|
18
|
-
this.builtinExtensionsPromises = [];
|
|
19
|
-
if (isWeb) {
|
|
20
|
-
const nlsBaseUrl = productService.extensionsGallery?.nlsBaseUrl;
|
|
21
|
-
if (nlsBaseUrl && productService.commit && !Language.isDefaultVariant()) {
|
|
22
|
-
this.nlsUrl = URI.joinPath(( URI.parse(nlsBaseUrl)), productService.commit, productService.version, Language.value());
|
|
23
|
-
}
|
|
24
|
-
const builtinExtensionsServiceUrl = ( FileAccess.asBrowserUri(builtinExtensionsPath));
|
|
25
|
-
if (builtinExtensionsServiceUrl) {
|
|
26
|
-
let bundledExtensions = [];
|
|
27
|
-
if (environmentService.isBuilt) {
|
|
28
|
-
bundledExtensions = [ ];
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
const builtinExtensionsElement = mainWindow.document.getElementById('vscode-workbench-builtin-extensions');
|
|
32
|
-
const builtinExtensionsElementAttribute = builtinExtensionsElement ? builtinExtensionsElement.getAttribute('data-settings') : undefined;
|
|
33
|
-
if (builtinExtensionsElementAttribute) {
|
|
34
|
-
try {
|
|
35
|
-
bundledExtensions = JSON.parse(builtinExtensionsElementAttribute);
|
|
36
|
-
}
|
|
37
|
-
catch (error) { }
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
this.builtinExtensionsPromises = ( bundledExtensions.map(async (e) => {
|
|
41
|
-
const id = getGalleryExtensionId(e.packageJSON.publisher, e.packageJSON.name);
|
|
42
|
-
return {
|
|
43
|
-
identifier: { id },
|
|
44
|
-
location: uriIdentityService.extUri.joinPath(builtinExtensionsServiceUrl, e.extensionPath),
|
|
45
|
-
type: 0 ,
|
|
46
|
-
isBuiltin: true,
|
|
47
|
-
manifest: e.packageNLS ? await this.localizeManifest(id, e.packageJSON, e.packageNLS) : e.packageJSON,
|
|
48
|
-
readmeUrl: e.readmePath ? uriIdentityService.extUri.joinPath(builtinExtensionsServiceUrl, e.readmePath) : undefined,
|
|
49
|
-
changelogUrl: e.changelogPath ? uriIdentityService.extUri.joinPath(builtinExtensionsServiceUrl, e.changelogPath) : undefined,
|
|
50
|
-
targetPlatform: "web" ,
|
|
51
|
-
validations: [],
|
|
52
|
-
isValid: true
|
|
53
|
-
};
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
async scanBuiltinExtensions() {
|
|
59
|
-
return [...(await Promise.all(this.builtinExtensionsPromises))];
|
|
60
|
-
}
|
|
61
|
-
async localizeManifest(extensionId, manifest, fallbackTranslations) {
|
|
62
|
-
if (!this.nlsUrl) {
|
|
63
|
-
return localizeManifest(this.logService, manifest, fallbackTranslations);
|
|
64
|
-
}
|
|
65
|
-
const uri = URI.joinPath(this.nlsUrl, extensionId, 'package');
|
|
66
|
-
try {
|
|
67
|
-
const res = await this.extensionResourceLoaderService.readExtensionResource(uri);
|
|
68
|
-
const json = JSON.parse(( res.toString()));
|
|
69
|
-
return localizeManifest(this.logService, manifest, json, fallbackTranslations);
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
this.logService.error(e);
|
|
73
|
-
return localizeManifest(this.logService, manifest, fallbackTranslations);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
BuiltinExtensionsScannerService = ( __decorate([
|
|
78
|
-
( __param(0, IWorkbenchEnvironmentService)),
|
|
79
|
-
( __param(1, IUriIdentityService)),
|
|
80
|
-
( __param(2, IExtensionResourceLoaderService)),
|
|
81
|
-
( __param(3, IProductService)),
|
|
82
|
-
( __param(4, ILogService))
|
|
83
|
-
], BuiltinExtensionsScannerService));
|
|
84
|
-
|
|
85
|
-
export { BuiltinExtensionsScannerService };
|