@codingame/monaco-vscode-extension-gallery-service-override 1.83.9

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 (66) hide show
  1. package/extensionGallery.d.ts +12 -0
  2. package/extensionGallery.js +76 -0
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
  4. package/external/tslib/tslib.es6.js +11 -0
  5. package/index.d.ts +1 -0
  6. package/index.js +1 -0
  7. package/override/vs/platform/dialogs/common/dialogs.js +8 -0
  8. package/package.json +30 -0
  9. package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js +784 -0
  10. package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +142 -0
  11. package/vscode/src/vs/platform/extensionManagement/common/extensionGalleryService.js +855 -0
  12. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementIpc.js +119 -0
  13. package/vscode/src/vs/platform/extensionManagement/common/extensionTipsService.js +57 -0
  14. package/vscode/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.js +58 -0
  15. package/vscode/src/vs/platform/externalServices/common/marketplace.js +17 -0
  16. package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +492 -0
  17. package/vscode/src/vs/workbench/contrib/extensions/browser/browserRuntimeExtensionsEditor.js +28 -0
  18. package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +78 -0
  19. package/vscode/src/vs/workbench/contrib/extensions/browser/deprecatedExtensionsChecker.js +87 -0
  20. package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +60 -0
  21. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +1868 -0
  22. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +52 -0
  23. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +437 -0
  24. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendations.js +17 -0
  25. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.js +221 -0
  26. package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +2063 -0
  27. package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.web.contribution.js +13 -0
  28. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +46 -0
  29. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +65 -0
  30. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +98 -0
  31. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsList.js +224 -0
  32. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +121 -0
  33. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +285 -0
  34. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +912 -0
  35. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +1270 -0
  36. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +824 -0
  37. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +1730 -0
  38. package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +324 -0
  39. package/vscode/src/vs/workbench/contrib/extensions/browser/keymapRecommendations.js +28 -0
  40. package/vscode/src/vs/workbench/contrib/extensions/browser/languageRecommendations.js +28 -0
  41. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extension.css.js +6 -0
  42. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css.js +6 -0
  43. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css.js +6 -0
  44. package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsWidgets.css.js +6 -0
  45. package/vscode/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css.js +6 -0
  46. package/vscode/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.js +29 -0
  47. package/vscode/src/vs/workbench/contrib/extensions/browser/unsupportedExtensionsMigrationContribution.js +26 -0
  48. package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +38 -0
  49. package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +88 -0
  50. package/vscode/src/vs/workbench/contrib/extensions/common/extensionQuery.js +67 -0
  51. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +43 -0
  52. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +104 -0
  53. package/vscode/src/vs/workbench/contrib/extensions/common/reportExtensionIssueAction.js +31 -0
  54. package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +41 -0
  55. package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +207 -0
  56. package/vscode/src/vs/workbench/contrib/update/common/update.js +3 -0
  57. package/vscode/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.js +84 -0
  58. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.js +634 -0
  59. package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +883 -0
  60. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementChannelClient.js +109 -0
  61. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.js +62 -0
  62. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.js +633 -0
  63. package/vscode/src/vs/workbench/services/extensionManagement/common/remoteExtensionManagementService.js +58 -0
  64. package/vscode/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.js +269 -0
  65. package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService.js +83 -0
  66. package/vscode/src/vs/workbench/services/remote/common/remoteExtensionsScanner.js +73 -0
@@ -0,0 +1,88 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { EXTENSION_IDENTIFIER_PATTERN } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
3
+ import { distinct, flatten } from 'monaco-editor/esm/vs/base/common/arrays.js';
4
+ import { ExtensionRecommendations } from './extensionRecommendations.js';
5
+ import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
6
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
7
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
8
+ import { IWorkspaceExtensionsConfigService } from 'vscode/vscode/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig';
9
+
10
+ let WorkspaceRecommendations = class WorkspaceRecommendations extends ExtensionRecommendations {
11
+ get recommendations() { return this._recommendations; }
12
+ get ignoredRecommendations() { return this._ignoredRecommendations; }
13
+ constructor(workspaceExtensionsConfigService, notificationService) {
14
+ super();
15
+ this.workspaceExtensionsConfigService = workspaceExtensionsConfigService;
16
+ this.notificationService = notificationService;
17
+ this._recommendations = [];
18
+ this._onDidChangeRecommendations = this._register(( new Emitter()));
19
+ this.onDidChangeRecommendations = this._onDidChangeRecommendations.event;
20
+ this._ignoredRecommendations = [];
21
+ }
22
+ async doActivate() {
23
+ await this.fetch();
24
+ this._register(this.workspaceExtensionsConfigService.onDidChangeExtensionsConfigs(() => this.onDidChangeExtensionsConfigs()));
25
+ }
26
+ async fetch() {
27
+ const extensionsConfigs = await this.workspaceExtensionsConfigService.getExtensionsConfigs();
28
+ const { invalidRecommendations, message } = await this.validateExtensions(extensionsConfigs);
29
+ if (invalidRecommendations.length) {
30
+ this.notificationService.warn(`The ${invalidRecommendations.length} extension(s) below, in workspace recommendations have issues:\n${message}`);
31
+ }
32
+ this._recommendations = [];
33
+ this._ignoredRecommendations = [];
34
+ for (const extensionsConfig of extensionsConfigs) {
35
+ if (extensionsConfig.unwantedRecommendations) {
36
+ for (const unwantedRecommendation of extensionsConfig.unwantedRecommendations) {
37
+ if (invalidRecommendations.indexOf(unwantedRecommendation) === -1) {
38
+ this._ignoredRecommendations.push(unwantedRecommendation);
39
+ }
40
+ }
41
+ }
42
+ if (extensionsConfig.recommendations) {
43
+ for (const extensionId of extensionsConfig.recommendations) {
44
+ if (invalidRecommendations.indexOf(extensionId) === -1) {
45
+ this._recommendations.push({
46
+ extensionId,
47
+ reason: {
48
+ reasonId: 0 ,
49
+ reasonText: ( localizeWithPath(
50
+ 'vs/workbench/contrib/extensions/browser/workspaceRecommendations',
51
+ 'workspaceRecommendation',
52
+ "This extension is recommended by users of the current workspace."
53
+ ))
54
+ }
55
+ });
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ async validateExtensions(contents) {
62
+ const validExtensions = [];
63
+ const invalidExtensions = [];
64
+ let message = '';
65
+ const allRecommendations = distinct(flatten(( contents.map(({ recommendations }) => recommendations || []))));
66
+ const regEx = ( new RegExp(EXTENSION_IDENTIFIER_PATTERN));
67
+ for (const extensionId of allRecommendations) {
68
+ if (regEx.test(extensionId)) {
69
+ validExtensions.push(extensionId);
70
+ }
71
+ else {
72
+ invalidExtensions.push(extensionId);
73
+ message += `${extensionId} (bad format) Expected: <provider>.<name>\n`;
74
+ }
75
+ }
76
+ return { validRecommendations: validExtensions, invalidRecommendations: invalidExtensions, message };
77
+ }
78
+ async onDidChangeExtensionsConfigs() {
79
+ await this.fetch();
80
+ this._onDidChangeRecommendations.fire();
81
+ }
82
+ };
83
+ WorkspaceRecommendations = ( __decorate([
84
+ ( __param(0, IWorkspaceExtensionsConfigService)),
85
+ ( __param(1, INotificationService))
86
+ ], WorkspaceRecommendations));
87
+
88
+ export { WorkspaceRecommendations };
@@ -0,0 +1,67 @@
1
+ import { flatten } from 'monaco-editor/esm/vs/base/common/arrays.js';
2
+ import { EXTENSION_CATEGORIES } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
3
+
4
+ class Query {
5
+ constructor(value, sortBy, groupBy) {
6
+ this.value = value;
7
+ this.sortBy = sortBy;
8
+ this.groupBy = groupBy;
9
+ this.value = value.trim();
10
+ }
11
+ static suggestions(query) {
12
+ const commands = ['installed', 'updates', 'enabled', 'disabled', 'builtin', 'featured', 'popular', 'recommended', 'recentlyPublished', 'workspaceUnsupported', 'deprecated', 'sort', 'category', 'tag', 'ext', 'id'];
13
+ const subcommands = {
14
+ 'sort': ['installs', 'rating', 'name', 'publishedDate', 'updateDate'],
15
+ 'category': ( EXTENSION_CATEGORIES.map(c => `"${c.toLowerCase()}"`)),
16
+ 'tag': [''],
17
+ 'ext': [''],
18
+ 'id': ['']
19
+ };
20
+ const queryContains = (substr) => query.indexOf(substr) > -1;
21
+ const hasSort = ( subcommands.sort.some(subcommand => queryContains(`@sort:${subcommand}`)));
22
+ const hasCategory = ( subcommands.category.some(subcommand => queryContains(`@category:${subcommand}`)));
23
+ return flatten(( commands.map(command => {
24
+ if (hasSort && command === 'sort' || hasCategory && command === 'category') {
25
+ return [];
26
+ }
27
+ if (command in subcommands) {
28
+ return ( subcommands[command]
29
+ .map(subcommand => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`));
30
+ }
31
+ else {
32
+ return queryContains(`@${command}`) ? [] : [`@${command} `];
33
+ }
34
+ })));
35
+ }
36
+ static parse(value) {
37
+ let sortBy = '';
38
+ value = value.replace(/@sort:(\w+)(-\w*)?/g, (match, by, order) => {
39
+ sortBy = by;
40
+ return '';
41
+ });
42
+ let groupBy = '';
43
+ value = value.replace(/@group:(\w+)(-\w*)?/g, (match, by, order) => {
44
+ groupBy = by;
45
+ return '';
46
+ });
47
+ return ( new Query(value, sortBy, groupBy));
48
+ }
49
+ toString() {
50
+ let result = this.value;
51
+ if (this.sortBy) {
52
+ result = `${result}${result ? ' ' : ''}@sort:${this.sortBy}`;
53
+ }
54
+ if (this.groupBy) {
55
+ result = `${result}${result ? ' ' : ''}@group:${this.groupBy}`;
56
+ }
57
+ return result;
58
+ }
59
+ isValid() {
60
+ return !/@outdated/.test(this.value);
61
+ }
62
+ equals(other) {
63
+ return this.value === other.value && this.sortBy === other.sortBy;
64
+ }
65
+ }
66
+
67
+ export { Query };
@@ -0,0 +1,43 @@
1
+ import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
2
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
3
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
4
+ import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
5
+ import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
6
+ import { join } from 'monaco-editor/esm/vs/base/common/path.js';
7
+
8
+ class ExtensionsInput extends EditorInput {
9
+ static { this.ID = 'workbench.extensions.input2'; }
10
+ get typeId() {
11
+ return ExtensionsInput.ID;
12
+ }
13
+ get capabilities() {
14
+ return 2 | 8 ;
15
+ }
16
+ get resource() {
17
+ return ( URI.from({
18
+ scheme: Schemas.extension,
19
+ path: join(this._extension.identifier.id, 'extension')
20
+ }));
21
+ }
22
+ constructor(_extension) {
23
+ super();
24
+ this._extension = _extension;
25
+ }
26
+ get extension() { return this._extension; }
27
+ getName() {
28
+ return ( localizeWithPath(
29
+ 'vs/workbench/contrib/extensions/common/extensionsInput',
30
+ 'extensionsInputName',
31
+ "Extension: {0}",
32
+ this._extension.displayName
33
+ ));
34
+ }
35
+ matches(other) {
36
+ if (super.matches(other)) {
37
+ return true;
38
+ }
39
+ return other instanceof ExtensionsInput && areSameExtensions(this._extension.identifier, other._extension.identifier);
40
+ }
41
+ }
42
+
43
+ export { ExtensionsInput };
@@ -0,0 +1,104 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
3
+ import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
4
+ import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
5
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
6
+ import { IExtensionManagementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
7
+ import { IWorkbenchExtensionEnablementService } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionManagement';
8
+ import { IExtensionRecommendationsService } from 'vscode/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations';
9
+ import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
10
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
11
+ import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
12
+ import { Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
13
+
14
+ let KeymapExtensions = class KeymapExtensions extends Disposable {
15
+ constructor(instantiationService, extensionEnablementService, tipsService, lifecycleService, notificationService) {
16
+ super();
17
+ this.instantiationService = instantiationService;
18
+ this.extensionEnablementService = extensionEnablementService;
19
+ this.tipsService = tipsService;
20
+ this.notificationService = notificationService;
21
+ this._register(lifecycleService.onDidShutdown(() => this.dispose()));
22
+ this._register(instantiationService.invokeFunction(onExtensionChanged)((identifiers => {
23
+ Promise.all(( identifiers.map(identifier => this.checkForOtherKeymaps(identifier))))
24
+ .then(undefined, onUnexpectedError);
25
+ })));
26
+ }
27
+ checkForOtherKeymaps(extensionIdentifier) {
28
+ return this.instantiationService.invokeFunction(getInstalledExtensions).then(extensions => {
29
+ const keymaps = extensions.filter(extension => isKeymapExtension(this.tipsService, extension));
30
+ const extension = keymaps.find(extension => areSameExtensions(extension.identifier, extensionIdentifier));
31
+ if (extension && extension.globallyEnabled) {
32
+ const otherKeymaps = keymaps.filter(extension => !areSameExtensions(extension.identifier, extensionIdentifier) && extension.globallyEnabled);
33
+ if (otherKeymaps.length) {
34
+ return this.promptForDisablingOtherKeymaps(extension, otherKeymaps);
35
+ }
36
+ }
37
+ return undefined;
38
+ });
39
+ }
40
+ promptForDisablingOtherKeymaps(newKeymap, oldKeymaps) {
41
+ const onPrompt = (confirmed) => {
42
+ if (confirmed) {
43
+ this.extensionEnablementService.setEnablement(( oldKeymaps.map(keymap => keymap.local)), 6 );
44
+ }
45
+ };
46
+ this.notificationService.prompt(Severity.Info, ( localizeWithPath(
47
+ 'vs/workbench/contrib/extensions/common/extensionsUtils',
48
+ 'disableOtherKeymapsConfirmation',
49
+ "Disable other keymaps ({0}) to avoid conflicts between keybindings?",
50
+ ( oldKeymaps.map(k => `'${k.local.manifest.displayName}'`)).join(', ')
51
+ )), [{
52
+ label: ( localizeWithPath('vs/workbench/contrib/extensions/common/extensionsUtils', 'yes', "Yes")),
53
+ run: () => onPrompt(true)
54
+ }, {
55
+ label: ( localizeWithPath('vs/workbench/contrib/extensions/common/extensionsUtils', 'no', "No")),
56
+ run: () => onPrompt(false)
57
+ }]);
58
+ }
59
+ };
60
+ KeymapExtensions = ( __decorate([
61
+ ( __param(0, IInstantiationService)),
62
+ ( __param(1, IWorkbenchExtensionEnablementService)),
63
+ ( __param(2, IExtensionRecommendationsService)),
64
+ ( __param(3, ILifecycleService)),
65
+ ( __param(4, INotificationService))
66
+ ], KeymapExtensions));
67
+ function onExtensionChanged(accessor) {
68
+ const extensionService = accessor.get(IExtensionManagementService);
69
+ const extensionEnablementService = accessor.get(IWorkbenchExtensionEnablementService);
70
+ const onDidInstallExtensions = Event.chain(extensionService.onDidInstallExtensions, $ => ( $.filter(e => ( e.some(({ operation }) => operation === 2 )))
71
+ .map(e => ( e.map(({ identifier }) => identifier)))));
72
+ return Event.debounce(Event.any(Event.any(onDidInstallExtensions, ( Event.map(extensionService.onDidUninstallExtension, e => [e.identifier]))), ( Event.map(
73
+ extensionEnablementService.onEnablementChanged,
74
+ extensions => ( extensions.map(e => e.identifier))
75
+ ))), (result, identifiers) => {
76
+ result = result || [];
77
+ for (const identifier of identifiers) {
78
+ if (( result.some(l => !areSameExtensions(l, identifier)))) {
79
+ result.push(identifier);
80
+ }
81
+ }
82
+ return result;
83
+ });
84
+ }
85
+ async function getInstalledExtensions(accessor) {
86
+ const extensionService = accessor.get(IExtensionManagementService);
87
+ const extensionEnablementService = accessor.get(IWorkbenchExtensionEnablementService);
88
+ const extensions = await extensionService.getInstalled();
89
+ return ( extensions.map(extension => {
90
+ return {
91
+ identifier: extension.identifier,
92
+ local: extension,
93
+ globallyEnabled: extensionEnablementService.isEnabled(extension)
94
+ };
95
+ }));
96
+ }
97
+ function isKeymapExtension(tipsService, extension) {
98
+ const cats = extension.local.manifest.categories;
99
+ return cats && cats.indexOf('Keymaps') !== -1 || ( tipsService.getKeymapRecommendations().some(
100
+ extensionId => areSameExtensions({ id: extensionId }, extension.local.identifier)
101
+ ));
102
+ }
103
+
104
+ export { KeymapExtensions, getInstalledExtensions };
@@ -0,0 +1,31 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
3
+ import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
4
+ import { IWorkbenchIssueService } from 'vscode/vscode/vs/workbench/services/issue/common/issue';
5
+
6
+ var ReportExtensionIssueAction_1;
7
+ let ReportExtensionIssueAction = class ReportExtensionIssueAction extends Action {
8
+ static { ReportExtensionIssueAction_1 = this; }
9
+ static { this._id = 'workbench.extensions.action.reportExtensionIssue'; }
10
+ static { this._label = ( nls.localizeWithPath(
11
+ 'vs/workbench/contrib/extensions/common/reportExtensionIssueAction',
12
+ 'reportExtensionIssue',
13
+ "Report Issue"
14
+ )); }
15
+ constructor(extension, issueService) {
16
+ super(ReportExtensionIssueAction_1._id, ReportExtensionIssueAction_1._label, 'extension-action report-issue');
17
+ this.extension = extension;
18
+ this.issueService = issueService;
19
+ this.enabled = extension.isBuiltin || (!!extension.repository && !!extension.repository.url);
20
+ }
21
+ async run() {
22
+ await this.issueService.openReporter({
23
+ extensionId: this.extension.identifier.value,
24
+ });
25
+ }
26
+ };
27
+ ReportExtensionIssueAction = ReportExtensionIssueAction_1 = ( __decorate([
28
+ ( __param(1, IWorkbenchIssueService))
29
+ ], ReportExtensionIssueAction));
30
+
31
+ export { ReportExtensionIssueAction };
@@ -0,0 +1,41 @@
1
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
2
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
3
+ import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
4
+
5
+ class RuntimeExtensionsInput extends EditorInput {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.resource = ( URI.from({
9
+ scheme: 'runtime-extensions',
10
+ path: 'default'
11
+ }));
12
+ }
13
+ static { this.ID = 'workbench.runtimeExtensions.input'; }
14
+ get typeId() {
15
+ return RuntimeExtensionsInput.ID;
16
+ }
17
+ get capabilities() {
18
+ return 2 | 8 ;
19
+ }
20
+ static get instance() {
21
+ if (!RuntimeExtensionsInput._instance || RuntimeExtensionsInput._instance.isDisposed()) {
22
+ RuntimeExtensionsInput._instance = ( new RuntimeExtensionsInput());
23
+ }
24
+ return RuntimeExtensionsInput._instance;
25
+ }
26
+ getName() {
27
+ return ( nls.localizeWithPath(
28
+ 'vs/workbench/contrib/extensions/common/runtimeExtensionsInput',
29
+ 'extensionsInputName',
30
+ "Running Extensions"
31
+ ));
32
+ }
33
+ matches(other) {
34
+ if (super.matches(other)) {
35
+ return true;
36
+ }
37
+ return other instanceof RuntimeExtensionsInput;
38
+ }
39
+ }
40
+
41
+ export { RuntimeExtensionsInput };
@@ -0,0 +1,207 @@
1
+ import { hookDomPurifyHrefAndSrcSanitizer, basicMarkupHtmlTags } from 'monaco-editor/esm/vs/base/browser/dom.js';
2
+ import * as dompurify from 'monaco-editor/esm/vs/base/browser/dompurify/dompurify.js';
3
+ import { allowedMarkdownAttr } from 'monaco-editor/esm/vs/base/browser/markdownRenderer.js';
4
+ import { marked } from 'monaco-editor/esm/vs/base/common/marked/marked.js';
5
+ import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
6
+ import { tokenizeToString } from 'monaco-editor/esm/vs/editor/common/languages/textToHtmlTokenizer.js';
7
+ import { escape } from 'monaco-editor/esm/vs/base/common/strings.js';
8
+
9
+ const DEFAULT_MARKDOWN_STYLES = `
10
+ body {
11
+ padding: 10px 20px;
12
+ line-height: 22px;
13
+ max-width: 882px;
14
+ margin: 0 auto;
15
+ }
16
+
17
+ body *:last-child {
18
+ margin-bottom: 0;
19
+ }
20
+
21
+ img {
22
+ max-width: 100%;
23
+ max-height: 100%;
24
+ }
25
+
26
+ a {
27
+ text-decoration: none;
28
+ }
29
+
30
+ a:hover {
31
+ text-decoration: underline;
32
+ }
33
+
34
+ a:focus,
35
+ input:focus,
36
+ select:focus,
37
+ textarea:focus {
38
+ outline: 1px solid -webkit-focus-ring-color;
39
+ outline-offset: -1px;
40
+ }
41
+
42
+ hr {
43
+ border: 0;
44
+ height: 2px;
45
+ border-bottom: 2px solid;
46
+ }
47
+
48
+ h1 {
49
+ padding-bottom: 0.3em;
50
+ line-height: 1.2;
51
+ border-bottom-width: 1px;
52
+ border-bottom-style: solid;
53
+ }
54
+
55
+ h1, h2, h3 {
56
+ font-weight: normal;
57
+ }
58
+
59
+ table {
60
+ border-collapse: collapse;
61
+ }
62
+
63
+ th {
64
+ text-align: left;
65
+ border-bottom: 1px solid;
66
+ }
67
+
68
+ th,
69
+ td {
70
+ padding: 5px 10px;
71
+ }
72
+
73
+ table > tbody > tr + tr > td {
74
+ border-top-width: 1px;
75
+ border-top-style: solid;
76
+ }
77
+
78
+ blockquote {
79
+ margin: 0 7px 0 5px;
80
+ padding: 0 16px 0 10px;
81
+ border-left-width: 5px;
82
+ border-left-style: solid;
83
+ }
84
+
85
+ code {
86
+ font-family: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
87
+ }
88
+
89
+ pre {
90
+ padding: 16px;
91
+ border-radius: 3px;
92
+ overflow: auto;
93
+ }
94
+
95
+ pre code {
96
+ font-family: var(--vscode-editor-font-family);
97
+ font-weight: var(--vscode-editor-font-weight);
98
+ font-size: var(--vscode-editor-font-size);
99
+ line-height: 1.5;
100
+ color: var(--vscode-editor-foreground);
101
+ tab-size: 4;
102
+ }
103
+
104
+ .monaco-tokenized-source {
105
+ white-space: pre;
106
+ }
107
+
108
+ /** Theming */
109
+
110
+ .pre {
111
+ background-color: var(--vscode-textCodeBlock-background);
112
+ }
113
+
114
+ .vscode-high-contrast h1 {
115
+ border-color: rgb(0, 0, 0);
116
+ }
117
+
118
+ .vscode-light th {
119
+ border-color: rgba(0, 0, 0, 0.69);
120
+ }
121
+
122
+ .vscode-dark th {
123
+ border-color: rgba(255, 255, 255, 0.69);
124
+ }
125
+
126
+ .vscode-light h1,
127
+ .vscode-light hr,
128
+ .vscode-light td {
129
+ border-color: rgba(0, 0, 0, 0.18);
130
+ }
131
+
132
+ .vscode-dark h1,
133
+ .vscode-dark hr,
134
+ .vscode-dark td {
135
+ border-color: rgba(255, 255, 255, 0.18);
136
+ }
137
+
138
+ @media (forced-colors: active) and (prefers-color-scheme: light){
139
+ body {
140
+ forced-color-adjust: none;
141
+ }
142
+ }
143
+
144
+ @media (forced-colors: active) and (prefers-color-scheme: dark){
145
+ body {
146
+ forced-color-adjust: none;
147
+ }
148
+ }
149
+ `;
150
+ const allowedProtocols = [Schemas.http, Schemas.https, Schemas.command];
151
+ function sanitize(documentContent, allowUnknownProtocols) {
152
+ const hook = hookDomPurifyHrefAndSrcSanitizer(allowedProtocols, true);
153
+ try {
154
+ return dompurify.sanitize(documentContent, {
155
+ ...{
156
+ ALLOWED_TAGS: [
157
+ ...basicMarkupHtmlTags,
158
+ 'checkbox',
159
+ 'checklist',
160
+ ],
161
+ ALLOWED_ATTR: [
162
+ ...allowedMarkdownAttr,
163
+ 'data-command', 'name', 'id', 'role', 'tabindex',
164
+ 'x-dispatch',
165
+ 'required', 'checked', 'placeholder', 'when-checked', 'checked-on',
166
+ ],
167
+ },
168
+ ...(allowUnknownProtocols ? { ALLOW_UNKNOWN_PROTOCOLS: true } : {}),
169
+ });
170
+ }
171
+ finally {
172
+ hook.dispose();
173
+ }
174
+ }
175
+ async function renderMarkdownDocument(text, extensionService, languageService, shouldSanitize = true, allowUnknownProtocols = false, token) {
176
+ const highlight = (code, lang, callback) => {
177
+ if (!callback) {
178
+ return code;
179
+ }
180
+ if (typeof lang !== 'string') {
181
+ callback(null, `<code>${escape(code)}</code>`);
182
+ return '';
183
+ }
184
+ extensionService.whenInstalledExtensionsRegistered().then(async () => {
185
+ if (token?.isCancellationRequested) {
186
+ callback(null, '');
187
+ return;
188
+ }
189
+ const languageId = languageService.getLanguageIdByLanguageName(lang);
190
+ const html = await tokenizeToString(languageService, code, languageId);
191
+ callback(null, `<code>${html}</code>`);
192
+ });
193
+ return '';
194
+ };
195
+ return ( new Promise((resolve, reject) => {
196
+ marked(text, { highlight }, (err, value) => err ? reject(err) : resolve(value));
197
+ })).then(raw => {
198
+ if (shouldSanitize) {
199
+ return sanitize(raw, allowUnknownProtocols);
200
+ }
201
+ else {
202
+ return raw;
203
+ }
204
+ });
205
+ }
206
+
207
+ export { DEFAULT_MARKDOWN_STYLES, renderMarkdownDocument };
@@ -0,0 +1,3 @@
1
+ const ShowCurrentReleaseNotesActionId = 'update.showCurrentReleaseNotes';
2
+
3
+ export { ShowCurrentReleaseNotesActionId };
@@ -0,0 +1,84 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { isWeb, Language } from 'monaco-editor/esm/vs/base/common/platform.js';
3
+ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
4
+ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
5
+ import { getGalleryExtensionId } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
6
+ import { FileAccess, builtinExtensionsPath } from 'monaco-editor/esm/vs/base/common/network.js';
7
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
8
+ import { IExtensionResourceLoaderService } from 'vscode/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader';
9
+ import { IProductService } from 'monaco-editor/esm/vs/platform/product/common/productService.js';
10
+ import { localizeManifest } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionNls';
11
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
12
+
13
+ let BuiltinExtensionsScannerService = class BuiltinExtensionsScannerService {
14
+ constructor(environmentService, uriIdentityService, extensionResourceLoaderService, productService, logService) {
15
+ this.extensionResourceLoaderService = extensionResourceLoaderService;
16
+ this.logService = logService;
17
+ this.builtinExtensionsPromises = [];
18
+ if (isWeb) {
19
+ const nlsBaseUrl = productService.extensionsGallery?.nlsBaseUrl;
20
+ if (nlsBaseUrl && productService.commit && !Language.isDefaultVariant()) {
21
+ this.nlsUrl = URI.joinPath(( URI.parse(nlsBaseUrl)), productService.commit, productService.version, Language.value());
22
+ }
23
+ const builtinExtensionsServiceUrl = ( FileAccess.asBrowserUri(builtinExtensionsPath));
24
+ if (builtinExtensionsServiceUrl) {
25
+ let bundledExtensions = [];
26
+ if (environmentService.isBuilt) {
27
+ bundledExtensions = [ ];
28
+ }
29
+ else {
30
+ const builtinExtensionsElement = document.getElementById('vscode-workbench-builtin-extensions');
31
+ const builtinExtensionsElementAttribute = builtinExtensionsElement ? builtinExtensionsElement.getAttribute('data-settings') : undefined;
32
+ if (builtinExtensionsElementAttribute) {
33
+ try {
34
+ bundledExtensions = JSON.parse(builtinExtensionsElementAttribute);
35
+ }
36
+ catch (error) { }
37
+ }
38
+ }
39
+ this.builtinExtensionsPromises = ( bundledExtensions.map(async (e) => {
40
+ const id = getGalleryExtensionId(e.packageJSON.publisher, e.packageJSON.name);
41
+ return {
42
+ identifier: { id },
43
+ location: uriIdentityService.extUri.joinPath(builtinExtensionsServiceUrl, e.extensionPath),
44
+ type: 0 ,
45
+ isBuiltin: true,
46
+ manifest: e.packageNLS ? await this.localizeManifest(id, e.packageJSON, e.packageNLS) : e.packageJSON,
47
+ readmeUrl: e.readmePath ? uriIdentityService.extUri.joinPath(builtinExtensionsServiceUrl, e.readmePath) : undefined,
48
+ changelogUrl: e.changelogPath ? uriIdentityService.extUri.joinPath(builtinExtensionsServiceUrl, e.changelogPath) : undefined,
49
+ targetPlatform: "web" ,
50
+ validations: [],
51
+ isValid: true
52
+ };
53
+ }));
54
+ }
55
+ }
56
+ }
57
+ async scanBuiltinExtensions() {
58
+ return [...(await Promise.all(this.builtinExtensionsPromises))];
59
+ }
60
+ async localizeManifest(extensionId, manifest, fallbackTranslations) {
61
+ if (!this.nlsUrl) {
62
+ return localizeManifest(this.logService, manifest, fallbackTranslations);
63
+ }
64
+ const uri = URI.joinPath(this.nlsUrl, extensionId, 'package');
65
+ try {
66
+ const res = await this.extensionResourceLoaderService.readExtensionResource(uri);
67
+ const json = JSON.parse(( res.toString()));
68
+ return localizeManifest(this.logService, manifest, json, fallbackTranslations);
69
+ }
70
+ catch (e) {
71
+ this.logService.error(e);
72
+ return localizeManifest(this.logService, manifest, fallbackTranslations);
73
+ }
74
+ }
75
+ };
76
+ BuiltinExtensionsScannerService = ( __decorate([
77
+ ( __param(0, IWorkbenchEnvironmentService)),
78
+ ( __param(1, IUriIdentityService)),
79
+ ( __param(2, IExtensionResourceLoaderService)),
80
+ ( __param(3, IProductService)),
81
+ ( __param(4, ILogService))
82
+ ], BuiltinExtensionsScannerService));
83
+
84
+ export { BuiltinExtensionsScannerService };