@codingame/monaco-vscode-extension-gallery-service-override 2.2.2 → 3.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/extensionGallery.js +23 -8
- package/package.json +9 -9
- package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js +123 -163
- package/vscode/src/vs/platform/extensionManagement/common/extensionGalleryService.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +42 -7
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +43 -827
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +542 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +63 -54
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsList.js +0 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +10 -13
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +36 -8
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +2 -2
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +1 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extension.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.js +234 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.js +2 -2
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { append, $, addDisposableListener, setParentFlowTo
|
|
3
|
-
import { renderMarkdown } from 'vscode/vscode/vs/base/browser/markdownRenderer';
|
|
2
|
+
import { append, $, addDisposableListener, setParentFlowTo } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
3
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
5
|
-
import { KeybindingLabel } from 'vscode/vscode/vs/base/browser/ui/keybindingLabel/keybindingLabel';
|
|
6
4
|
import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
7
5
|
import { CheckboxActionViewItem } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
|
|
8
6
|
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
9
|
-
import { insert, isFalsyOrEmpty
|
|
7
|
+
import { insert, isFalsyOrEmpty } from 'vscode/vscode/vs/base/common/arrays';
|
|
10
8
|
import { Cache } from 'vscode/vscode/vs/base/common/cache';
|
|
11
9
|
import { CancellationToken, CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
12
|
-
import {
|
|
13
|
-
import { getErrorMessage, onUnexpectedError, isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
10
|
+
import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
14
11
|
import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
15
12
|
import { MutableDisposable, DisposableStore, toDisposable, Disposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
16
13
|
import { matchesScheme, Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
17
|
-
import { language
|
|
18
|
-
import { platform } from 'vscode/vscode/vs/base/common/process';
|
|
14
|
+
import { language } from 'vscode/vscode/vs/base/common/platform';
|
|
19
15
|
import { valid } from 'vscode-semver';
|
|
20
|
-
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
21
16
|
import { isUndefined } from 'vscode/vscode/vs/base/common/types';
|
|
22
17
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
23
18
|
import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
|
|
@@ -28,24 +23,21 @@ import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/langu
|
|
|
28
23
|
import { generateTokensCSSForColorMap } from 'vscode/vscode/vs/editor/common/languages/supports/tokenization';
|
|
29
24
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
30
25
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
31
|
-
import { getDefaultValue } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
32
26
|
import { RawContextKey, ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
33
27
|
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
34
28
|
import { IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
35
29
|
import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
36
|
-
import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
37
30
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
38
|
-
import {
|
|
39
|
-
import { Severity, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
31
|
+
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
40
32
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
41
33
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
42
34
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
43
|
-
import { defaultCheckboxStyles
|
|
35
|
+
import { defaultCheckboxStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
44
36
|
import { editorBackground, textLinkForeground, textLinkActiveForeground, buttonHoverBackground, buttonForeground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
45
37
|
import { registerThemingParticipant, IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
46
38
|
import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
39
|
+
import { ExtensionFeaturesTab } from './extensionFeaturesTab.js';
|
|
47
40
|
import { InstallDropdownAction, ReloadAction, ExtensionStatusLabelAction, ActionWithDropDownAction, UpdateAction, ToggleAutoUpdateForExtensionAction, SetColorThemeAction, SetFileIconThemeAction, SetProductIconThemeAction, SetLanguageAction, ClearLanguageAction, EnableDropDownAction, DisableDropDownAction, RemoteInstallAction, LocalInstallAction, WebInstallAction, InstallingLabelAction, UninstallAction, MigrateDeprecatedExtensionAction, InstallAnotherVersionAction, TogglePreReleaseExtensionAction, ExtensionEditorManageExtensionAction, ExtensionDropDownAction, ExtensionActionWithDropdownActionViewItem, ExtensionStatusAction } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
|
|
48
|
-
import { errorIcon, warningIcon, infoIcon } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons';
|
|
49
41
|
import { Delegate } from './extensionsList.js';
|
|
50
42
|
import { ExtensionsTree, ExtensionData, ExtensionsGridView, getExtensions } from './extensionsViewer.js';
|
|
51
43
|
import { RemoteBadgeWidget, VerifiedPublisherWidget, InstallCountWidget, RatingsWidget, SponsorWidget, ExtensionStatusWidget, ExtensionWidget, ExtensionRecommendationWidget, onClick } from './extensionsWidgets.js';
|
|
@@ -68,7 +60,7 @@ class NavBar extends Disposable {
|
|
|
68
60
|
this._currentId = null;
|
|
69
61
|
const element = append(container, $('.navbar'));
|
|
70
62
|
this.actions = [];
|
|
71
|
-
this.actionbar = this._register(( new ActionBar(element
|
|
63
|
+
this.actionbar = this._register(( new ActionBar(element)));
|
|
72
64
|
}
|
|
73
65
|
push(id, label, tooltip) {
|
|
74
66
|
const action = ( new Action(id, label, undefined, true, () => this.update(id, true)));
|
|
@@ -132,13 +124,12 @@ class VersionWidget extends ExtensionWithDifferentGalleryVersionWidget {
|
|
|
132
124
|
let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
133
125
|
static { ExtensionEditor_1 = this; }
|
|
134
126
|
static { this.ID = 'workbench.editor.extension'; }
|
|
135
|
-
constructor(telemetryService, instantiationService, paneCompositeService, extensionsWorkbenchService, extensionGalleryService, themeService,
|
|
127
|
+
constructor(telemetryService, instantiationService, paneCompositeService, extensionsWorkbenchService, extensionGalleryService, themeService, notificationService, openerService, extensionRecommendationsService, storageService, extensionService, webviewService, languageService, contextMenuService, contextKeyService) {
|
|
136
128
|
super(ExtensionEditor_1.ID, telemetryService, themeService, storageService);
|
|
137
129
|
this.instantiationService = instantiationService;
|
|
138
130
|
this.paneCompositeService = paneCompositeService;
|
|
139
131
|
this.extensionsWorkbenchService = extensionsWorkbenchService;
|
|
140
132
|
this.extensionGalleryService = extensionGalleryService;
|
|
141
|
-
this.keybindingService = keybindingService;
|
|
142
133
|
this.notificationService = notificationService;
|
|
143
134
|
this.openerService = openerService;
|
|
144
135
|
this.extensionRecommendationsService = extensionRecommendationsService;
|
|
@@ -262,7 +253,6 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
262
253
|
];
|
|
263
254
|
const actionsAndStatusContainer = append(details, $('.actions-status-container'));
|
|
264
255
|
const extensionActionBar = this._register(( new ActionBar(actionsAndStatusContainer, {
|
|
265
|
-
animated: false,
|
|
266
256
|
actionViewItemProvider: (action) => {
|
|
267
257
|
if (action instanceof ExtensionDropDownAction) {
|
|
268
258
|
return action.createActionViewItem();
|
|
@@ -465,15 +455,15 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
465
455
|
'detailstooltip',
|
|
466
456
|
"Extension details, rendered from the extension's 'README.md' file"
|
|
467
457
|
)));
|
|
468
|
-
if (manifest
|
|
469
|
-
template.navbar.push("
|
|
458
|
+
if (manifest) {
|
|
459
|
+
template.navbar.push("features" , ( localizeWithPath(
|
|
470
460
|
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
471
|
-
'
|
|
472
|
-
"
|
|
461
|
+
'features',
|
|
462
|
+
"Features"
|
|
473
463
|
)), ( localizeWithPath(
|
|
474
464
|
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
475
|
-
'
|
|
476
|
-
"Lists
|
|
465
|
+
'featurestooltip',
|
|
466
|
+
"Lists features contributed by this extension"
|
|
477
467
|
)));
|
|
478
468
|
}
|
|
479
469
|
if (extension.hasChangelog()) {
|
|
@@ -509,27 +499,8 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
509
499
|
"Lists extensions those will be installed together with this extension"
|
|
510
500
|
)));
|
|
511
501
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
'runtimeStatus',
|
|
515
|
-
"Runtime Status"
|
|
516
|
-
)), ( localizeWithPath(
|
|
517
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
518
|
-
'runtimeStatus description',
|
|
519
|
-
"Extension runtime status"
|
|
520
|
-
)));
|
|
521
|
-
if (this.extensionsWorkbenchService.getExtensionStatus(extension)) {
|
|
522
|
-
addRuntimeStatusSection();
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
const disposable = this.extensionService.onDidChangeExtensionsStatus(e => {
|
|
526
|
-
if (( e.some(
|
|
527
|
-
extensionIdentifier => areSameExtensions({ id: extensionIdentifier.value }, extension.identifier)
|
|
528
|
-
))) {
|
|
529
|
-
addRuntimeStatusSection();
|
|
530
|
-
disposable.dispose();
|
|
531
|
-
}
|
|
532
|
-
}, this, this.transientDisposables);
|
|
502
|
+
if (this.options?.tab) {
|
|
503
|
+
template.navbar.switch(this.options.tab);
|
|
533
504
|
}
|
|
534
505
|
if (template.navbar.currentId) {
|
|
535
506
|
this.onNavbarChange(extension, { id: template.navbar.currentId, focus: !preserveFocus }, template);
|
|
@@ -579,11 +550,10 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
579
550
|
open(id, extension, template, token) {
|
|
580
551
|
switch (id) {
|
|
581
552
|
case "readme" : return this.openDetails(extension, template, token);
|
|
582
|
-
case "
|
|
553
|
+
case "features" : return this.openFeatures(template, token);
|
|
583
554
|
case "changelog" : return this.openChangelog(template, token);
|
|
584
555
|
case "dependencies" : return this.openExtensionDependencies(extension, template, token);
|
|
585
556
|
case "extensionPack" : return this.openExtensionPack(extension, template, token);
|
|
586
|
-
case "runtimeStatus" : return this.openRuntimeStatus(extension, template, token);
|
|
587
557
|
}
|
|
588
558
|
return Promise.resolve(null);
|
|
589
559
|
}
|
|
@@ -871,7 +841,7 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
871
841
|
append(extensionResourcesContainer, $('.additional-details-title', undefined, ( localizeWithPath(
|
|
872
842
|
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
873
843
|
'resources',
|
|
874
|
-
"
|
|
844
|
+
"Resources"
|
|
875
845
|
))));
|
|
876
846
|
const resourcesElement = append(extensionResourcesContainer, $('.resources'));
|
|
877
847
|
for (const [label, uri] of resources) {
|
|
@@ -924,67 +894,21 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
924
894
|
"Changelog"
|
|
925
895
|
)), token);
|
|
926
896
|
}
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
this.renderSettings(content, manifest, layout),
|
|
943
|
-
this.renderCommands(content, manifest, layout),
|
|
944
|
-
this.renderCodeActions(content, manifest, layout),
|
|
945
|
-
this.renderLanguages(content, manifest, layout),
|
|
946
|
-
this.renderColorThemes(content, manifest, layout),
|
|
947
|
-
this.renderIconThemes(content, manifest, layout),
|
|
948
|
-
this.renderProductIconThemes(content, manifest, layout),
|
|
949
|
-
this.renderColors(content, manifest, layout),
|
|
950
|
-
this.renderJSONValidation(content, manifest, layout),
|
|
951
|
-
this.renderDebuggers(content, manifest, layout),
|
|
952
|
-
this.renderViewContainers(content, manifest, layout),
|
|
953
|
-
this.renderViews(content, manifest, layout),
|
|
954
|
-
this.renderLocalizations(content, manifest, layout),
|
|
955
|
-
this.renderCustomEditors(content, manifest, layout),
|
|
956
|
-
this.renderNotebooks(content, manifest, layout),
|
|
957
|
-
this.renderNotebookRenderers(content, manifest, layout),
|
|
958
|
-
this.renderAuthentication(content, manifest, layout),
|
|
959
|
-
this.renderActivationEvents(content, manifest, layout),
|
|
960
|
-
];
|
|
961
|
-
scrollableContent.scanDomNode();
|
|
962
|
-
const isEmpty = !( renders.some(x => x));
|
|
963
|
-
if (isEmpty) {
|
|
964
|
-
append(content, $('p.nocontent')).textContent = ( localizeWithPath(
|
|
965
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
966
|
-
'noContributions',
|
|
967
|
-
"No Contributions"
|
|
968
|
-
));
|
|
969
|
-
append(template.content, content);
|
|
970
|
-
}
|
|
971
|
-
else {
|
|
972
|
-
append(template.content, scrollableContent.getDomNode());
|
|
973
|
-
this.contentDisposables.add(scrollableContent);
|
|
974
|
-
}
|
|
975
|
-
return content;
|
|
976
|
-
}, () => {
|
|
977
|
-
if (token.isCancellationRequested) {
|
|
978
|
-
return null;
|
|
979
|
-
}
|
|
980
|
-
append(content, $('p.nocontent')).textContent = ( localizeWithPath(
|
|
981
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
982
|
-
'noContributions',
|
|
983
|
-
"No Contributions"
|
|
984
|
-
));
|
|
985
|
-
append(template.content, content);
|
|
986
|
-
return content;
|
|
987
|
-
});
|
|
897
|
+
async openFeatures(template, token) {
|
|
898
|
+
const manifest = await this.loadContents(() => this.extensionManifest.get(), template.content);
|
|
899
|
+
if (token.isCancellationRequested) {
|
|
900
|
+
return null;
|
|
901
|
+
}
|
|
902
|
+
if (!manifest) {
|
|
903
|
+
return null;
|
|
904
|
+
}
|
|
905
|
+
const extensionFeaturesTab = this.contentDisposables.add(this.instantiationService.createInstance(ExtensionFeaturesTab, manifest, this.options?.feature));
|
|
906
|
+
const layout = () => extensionFeaturesTab.layout(template.content.clientHeight, template.content.clientWidth);
|
|
907
|
+
const removeLayoutParticipant = insert(this.layoutParticipants, { layout });
|
|
908
|
+
this.contentDisposables.add(toDisposable(removeLayoutParticipant));
|
|
909
|
+
append(template.content, extensionFeaturesTab.domNode);
|
|
910
|
+
layout();
|
|
911
|
+
return extensionFeaturesTab.domNode;
|
|
988
912
|
}
|
|
989
913
|
openExtensionDependencies(extension, template, token) {
|
|
990
914
|
if (token.isCancellationRequested) {
|
|
@@ -1034,99 +958,6 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
1034
958
|
}
|
|
1035
959
|
return this.renderExtensionPack(manifest, template.content, token);
|
|
1036
960
|
}
|
|
1037
|
-
async openRuntimeStatus(extension, template, token) {
|
|
1038
|
-
const content = $('div', { class: 'subcontent', tabindex: '0' });
|
|
1039
|
-
const scrollableContent = ( new DomScrollableElement(content, {}));
|
|
1040
|
-
const layout = () => scrollableContent.scanDomNode();
|
|
1041
|
-
const removeLayoutParticipant = insert(this.layoutParticipants, { layout });
|
|
1042
|
-
this.contentDisposables.add(toDisposable(removeLayoutParticipant));
|
|
1043
|
-
const updateContent = () => {
|
|
1044
|
-
scrollableContent.scanDomNode();
|
|
1045
|
-
reset(content, this.renderRuntimeStatus(extension, layout));
|
|
1046
|
-
};
|
|
1047
|
-
updateContent();
|
|
1048
|
-
this.extensionService.onDidChangeExtensionsStatus(e => {
|
|
1049
|
-
if (( e.some(
|
|
1050
|
-
extensionIdentifier => areSameExtensions({ id: extensionIdentifier.value }, extension.identifier)
|
|
1051
|
-
))) {
|
|
1052
|
-
updateContent();
|
|
1053
|
-
}
|
|
1054
|
-
}, this, this.contentDisposables);
|
|
1055
|
-
this.contentDisposables.add(scrollableContent);
|
|
1056
|
-
append(template.content, scrollableContent.getDomNode());
|
|
1057
|
-
return content;
|
|
1058
|
-
}
|
|
1059
|
-
renderRuntimeStatus(extension, onDetailsToggle) {
|
|
1060
|
-
const extensionStatus = this.extensionsWorkbenchService.getExtensionStatus(extension);
|
|
1061
|
-
const element = $('.runtime-status');
|
|
1062
|
-
if (extensionStatus?.activationTimes) {
|
|
1063
|
-
const activationTime = extensionStatus.activationTimes.codeLoadingTime + extensionStatus.activationTimes.activateCallTime;
|
|
1064
|
-
const activationElement = append(element, $('div.activation-details'));
|
|
1065
|
-
const activationReasonElement = append(activationElement, $('div.activation-element-entry'));
|
|
1066
|
-
append(activationReasonElement, $('span.activation-message-title', undefined, ( localizeWithPath(
|
|
1067
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1068
|
-
'activation reason',
|
|
1069
|
-
"Activation Event:"
|
|
1070
|
-
))));
|
|
1071
|
-
append(activationReasonElement, $('code', undefined, extensionStatus.activationTimes.activationReason.startup ? ( localizeWithPath(
|
|
1072
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1073
|
-
'startup',
|
|
1074
|
-
"Startup"
|
|
1075
|
-
)) : extensionStatus.activationTimes.activationReason.activationEvent));
|
|
1076
|
-
const activationTimeElement = append(activationElement, $('div.activation-element-entry'));
|
|
1077
|
-
append(activationTimeElement, $('span.activation-message-title', undefined, ( localizeWithPath(
|
|
1078
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1079
|
-
'activation time',
|
|
1080
|
-
"Activation Time:"
|
|
1081
|
-
))));
|
|
1082
|
-
append(activationTimeElement, $('code', undefined, `${activationTime}ms`));
|
|
1083
|
-
if (ExtensionIdentifier.toKey(extensionStatus.activationTimes.activationReason.extensionId) !== ExtensionIdentifier.toKey(extension.identifier.id)) {
|
|
1084
|
-
const activatedByElement = append(activationElement, $('div.activation-element-entry'));
|
|
1085
|
-
append(activatedByElement, $('span.activation-message-title', undefined, ( localizeWithPath(
|
|
1086
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1087
|
-
'activatedBy',
|
|
1088
|
-
"Activated By:"
|
|
1089
|
-
))));
|
|
1090
|
-
append(activatedByElement, $('span', undefined, extensionStatus.activationTimes.activationReason.extensionId.value));
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
else if (extension.local && (extension.local.manifest.main || extension.local.manifest.browser)) {
|
|
1094
|
-
append(element, $('div.activation-message', undefined, ( localizeWithPath(
|
|
1095
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1096
|
-
'not yet activated',
|
|
1097
|
-
"Not yet activated."
|
|
1098
|
-
))));
|
|
1099
|
-
}
|
|
1100
|
-
if (extensionStatus?.runtimeErrors.length) {
|
|
1101
|
-
append(element, $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1102
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1103
|
-
'uncaught errors',
|
|
1104
|
-
"Uncaught Errors ({0})",
|
|
1105
|
-
extensionStatus.runtimeErrors.length
|
|
1106
|
-
))), $('div', undefined, ...( extensionStatus.runtimeErrors.map(
|
|
1107
|
-
error => $('div.message-entry', undefined, $(`span${ThemeIcon.asCSSSelector(errorIcon)}`, undefined), $('span', undefined, getErrorMessage(error)))
|
|
1108
|
-
)))));
|
|
1109
|
-
}
|
|
1110
|
-
if (extensionStatus?.messages.length) {
|
|
1111
|
-
append(element, $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1112
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1113
|
-
'messages',
|
|
1114
|
-
"Messages ({0})",
|
|
1115
|
-
extensionStatus?.messages.length
|
|
1116
|
-
))), $('div', undefined, ...( extensionStatus.messages.sort((a, b) => b.type - a.type)
|
|
1117
|
-
.map(
|
|
1118
|
-
message => $('div.message-entry', undefined, $(`span${ThemeIcon.asCSSSelector(message.type === Severity.Error ? errorIcon : message.type === Severity.Warning ? warningIcon : infoIcon)}`, undefined), $('span', undefined, message.message))
|
|
1119
|
-
)))));
|
|
1120
|
-
}
|
|
1121
|
-
if (element.children.length === 0) {
|
|
1122
|
-
append(element, $('div.no-status-message')).textContent = ( localizeWithPath(
|
|
1123
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1124
|
-
'noStatus',
|
|
1125
|
-
"No status available."
|
|
1126
|
-
));
|
|
1127
|
-
}
|
|
1128
|
-
return element;
|
|
1129
|
-
}
|
|
1130
961
|
async renderExtensionPack(manifest, parent, token) {
|
|
1131
962
|
if (token.isCancellationRequested) {
|
|
1132
963
|
return null;
|
|
@@ -1143,620 +974,6 @@ let ExtensionEditor = class ExtensionEditor extends EditorPane {
|
|
|
1143
974
|
this.contentDisposables.add(toDisposable(insert(this.layoutParticipants, { layout: () => scrollableContent.scanDomNode() })));
|
|
1144
975
|
return content;
|
|
1145
976
|
}
|
|
1146
|
-
renderSettings(container, manifest, onDetailsToggle) {
|
|
1147
|
-
const configuration = manifest.contributes?.configuration;
|
|
1148
|
-
let properties = {};
|
|
1149
|
-
if (Array.isArray(configuration)) {
|
|
1150
|
-
configuration.forEach(config => {
|
|
1151
|
-
properties = { ...properties, ...config.properties };
|
|
1152
|
-
});
|
|
1153
|
-
}
|
|
1154
|
-
else if (configuration) {
|
|
1155
|
-
properties = configuration.properties;
|
|
1156
|
-
}
|
|
1157
|
-
let contrib = properties ? ( Object.keys(properties)) : [];
|
|
1158
|
-
contrib = contrib.filter(key => {
|
|
1159
|
-
const config = properties[key];
|
|
1160
|
-
return !config.deprecationMessage && !config.markdownDeprecationMessage;
|
|
1161
|
-
});
|
|
1162
|
-
if (!contrib.length) {
|
|
1163
|
-
return false;
|
|
1164
|
-
}
|
|
1165
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1166
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1167
|
-
'settings',
|
|
1168
|
-
"Settings ({0})",
|
|
1169
|
-
contrib.length
|
|
1170
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1171
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1172
|
-
'setting name',
|
|
1173
|
-
"ID"
|
|
1174
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1175
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1176
|
-
'description',
|
|
1177
|
-
"Description"
|
|
1178
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1179
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1180
|
-
'default',
|
|
1181
|
-
"Default"
|
|
1182
|
-
)))), ...( contrib
|
|
1183
|
-
.sort((a, b) => a.localeCompare(b))
|
|
1184
|
-
.map(key => {
|
|
1185
|
-
let description = properties[key].description || '';
|
|
1186
|
-
if (properties[key].markdownDescription) {
|
|
1187
|
-
const { element, dispose } = renderMarkdown({ value: properties[key].markdownDescription }, { actionHandler: { callback: (content) => this.openerService.open(content).catch(onUnexpectedError), disposables: this.contentDisposables } });
|
|
1188
|
-
description = element;
|
|
1189
|
-
this.contentDisposables.add(toDisposable(dispose));
|
|
1190
|
-
}
|
|
1191
|
-
return $('tr', undefined, $('td', undefined, $('code', undefined, key)), $('td', undefined, description), $('td', undefined, $('code', undefined, `${isUndefined(properties[key].default) ? getDefaultValue(properties[key].type) : JSON.stringify(properties[key].default)}`)));
|
|
1192
|
-
}))));
|
|
1193
|
-
append(container, details);
|
|
1194
|
-
return true;
|
|
1195
|
-
}
|
|
1196
|
-
renderDebuggers(container, manifest, onDetailsToggle) {
|
|
1197
|
-
const contrib = manifest.contributes?.debuggers || [];
|
|
1198
|
-
if (!contrib.length) {
|
|
1199
|
-
return false;
|
|
1200
|
-
}
|
|
1201
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1202
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1203
|
-
'debuggers',
|
|
1204
|
-
"Debuggers ({0})",
|
|
1205
|
-
contrib.length
|
|
1206
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1207
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1208
|
-
'debugger name',
|
|
1209
|
-
"Name"
|
|
1210
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1211
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1212
|
-
'debugger type',
|
|
1213
|
-
"Type"
|
|
1214
|
-
)))), ...( contrib
|
|
1215
|
-
.sort((a, b) => a.label.localeCompare(b.label))
|
|
1216
|
-
.map(
|
|
1217
|
-
d => $('tr', undefined, $('td', undefined, d.label), $('td', undefined, d.type))
|
|
1218
|
-
))));
|
|
1219
|
-
append(container, details);
|
|
1220
|
-
return true;
|
|
1221
|
-
}
|
|
1222
|
-
renderViewContainers(container, manifest, onDetailsToggle) {
|
|
1223
|
-
const contrib = manifest.contributes?.viewsContainers || {};
|
|
1224
|
-
const viewContainers = ( Object.keys(contrib)).reduce((result, location) => {
|
|
1225
|
-
const viewContainersForLocation = contrib[location];
|
|
1226
|
-
result.push(...( viewContainersForLocation.map(viewContainer => ({ ...viewContainer, location }))));
|
|
1227
|
-
return result;
|
|
1228
|
-
}, []);
|
|
1229
|
-
if (!viewContainers.length) {
|
|
1230
|
-
return false;
|
|
1231
|
-
}
|
|
1232
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1233
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1234
|
-
'viewContainers',
|
|
1235
|
-
"View Containers ({0})",
|
|
1236
|
-
viewContainers.length
|
|
1237
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1238
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1239
|
-
'view container id',
|
|
1240
|
-
"ID"
|
|
1241
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1242
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1243
|
-
'view container title',
|
|
1244
|
-
"Title"
|
|
1245
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1246
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1247
|
-
'view container location',
|
|
1248
|
-
"Where"
|
|
1249
|
-
)))), ...( viewContainers
|
|
1250
|
-
.sort((a, b) => a.id.localeCompare(b.id))
|
|
1251
|
-
.map(
|
|
1252
|
-
viewContainer => $('tr', undefined, $('td', undefined, viewContainer.id), $('td', undefined, viewContainer.title), $('td', undefined, viewContainer.location))
|
|
1253
|
-
))));
|
|
1254
|
-
append(container, details);
|
|
1255
|
-
return true;
|
|
1256
|
-
}
|
|
1257
|
-
renderViews(container, manifest, onDetailsToggle) {
|
|
1258
|
-
const contrib = manifest.contributes?.views || {};
|
|
1259
|
-
const views = ( Object.keys(contrib)).reduce((result, location) => {
|
|
1260
|
-
const viewsForLocation = contrib[location];
|
|
1261
|
-
result.push(...( viewsForLocation.map(view => ({ ...view, location }))));
|
|
1262
|
-
return result;
|
|
1263
|
-
}, []);
|
|
1264
|
-
if (!views.length) {
|
|
1265
|
-
return false;
|
|
1266
|
-
}
|
|
1267
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1268
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1269
|
-
'views',
|
|
1270
|
-
"Views ({0})",
|
|
1271
|
-
views.length
|
|
1272
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath('vs/workbench/contrib/extensions/browser/extensionEditor', 'view id', "ID"))), $('th', undefined, ( localizeWithPath(
|
|
1273
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1274
|
-
'view name',
|
|
1275
|
-
"Name"
|
|
1276
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1277
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1278
|
-
'view location',
|
|
1279
|
-
"Where"
|
|
1280
|
-
)))), ...( views
|
|
1281
|
-
.sort((a, b) => a.id.localeCompare(b.id))
|
|
1282
|
-
.map(
|
|
1283
|
-
view => $('tr', undefined, $('td', undefined, view.id), $('td', undefined, view.name), $('td', undefined, view.location))
|
|
1284
|
-
))));
|
|
1285
|
-
append(container, details);
|
|
1286
|
-
return true;
|
|
1287
|
-
}
|
|
1288
|
-
renderLocalizations(container, manifest, onDetailsToggle) {
|
|
1289
|
-
const localizations = manifest.contributes?.localizations || [];
|
|
1290
|
-
if (!localizations.length) {
|
|
1291
|
-
return false;
|
|
1292
|
-
}
|
|
1293
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1294
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1295
|
-
'localizations',
|
|
1296
|
-
"Localizations ({0})",
|
|
1297
|
-
localizations.length
|
|
1298
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1299
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1300
|
-
'localizations language id',
|
|
1301
|
-
"Language ID"
|
|
1302
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1303
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1304
|
-
'localizations language name',
|
|
1305
|
-
"Language Name"
|
|
1306
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1307
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1308
|
-
'localizations localized language name',
|
|
1309
|
-
"Language Name (Localized)"
|
|
1310
|
-
)))), ...( localizations
|
|
1311
|
-
.sort((a, b) => a.languageId.localeCompare(b.languageId))
|
|
1312
|
-
.map(
|
|
1313
|
-
localization => $('tr', undefined, $('td', undefined, localization.languageId), $('td', undefined, localization.languageName || ''), $('td', undefined, localization.localizedLanguageName || ''))
|
|
1314
|
-
))));
|
|
1315
|
-
append(container, details);
|
|
1316
|
-
return true;
|
|
1317
|
-
}
|
|
1318
|
-
renderCustomEditors(container, manifest, onDetailsToggle) {
|
|
1319
|
-
const webviewEditors = manifest.contributes?.customEditors || [];
|
|
1320
|
-
if (!webviewEditors.length) {
|
|
1321
|
-
return false;
|
|
1322
|
-
}
|
|
1323
|
-
const renderEditors = Array.from(webviewEditors).sort((a, b) => a.viewType.localeCompare(b.viewType));
|
|
1324
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1325
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1326
|
-
'customEditors',
|
|
1327
|
-
"Custom Editors ({0})",
|
|
1328
|
-
renderEditors.length
|
|
1329
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1330
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1331
|
-
'customEditors view type',
|
|
1332
|
-
"View Type"
|
|
1333
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1334
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1335
|
-
'customEditors priority',
|
|
1336
|
-
"Priority"
|
|
1337
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1338
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1339
|
-
'customEditors filenamePattern',
|
|
1340
|
-
"Filename Pattern"
|
|
1341
|
-
)))), ...( renderEditors.map(
|
|
1342
|
-
webviewEditor => $('tr', undefined, $('td', undefined, webviewEditor.viewType), $('td', undefined, webviewEditor.priority), $('td', undefined, coalesce(( webviewEditor.selector.map(x => x.filenamePattern))).join(', ')))
|
|
1343
|
-
))));
|
|
1344
|
-
append(container, details);
|
|
1345
|
-
return true;
|
|
1346
|
-
}
|
|
1347
|
-
renderCodeActions(container, manifest, onDetailsToggle) {
|
|
1348
|
-
const codeActions = manifest.contributes?.codeActions || [];
|
|
1349
|
-
if (!codeActions.length) {
|
|
1350
|
-
return false;
|
|
1351
|
-
}
|
|
1352
|
-
const flatActions = flatten(( codeActions.map(contribution => ( contribution.actions.map(action => ({ ...action, languages: contribution.languages }))))));
|
|
1353
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1354
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1355
|
-
'codeActions',
|
|
1356
|
-
"Code Actions ({0})",
|
|
1357
|
-
flatActions.length
|
|
1358
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1359
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1360
|
-
'codeActions.title',
|
|
1361
|
-
"Title"
|
|
1362
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1363
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1364
|
-
'codeActions.kind',
|
|
1365
|
-
"Kind"
|
|
1366
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1367
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1368
|
-
'codeActions.description',
|
|
1369
|
-
"Description"
|
|
1370
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1371
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1372
|
-
'codeActions.languages',
|
|
1373
|
-
"Languages"
|
|
1374
|
-
)))), ...( flatActions
|
|
1375
|
-
.sort((a, b) => a.title.localeCompare(b.title))
|
|
1376
|
-
.map(
|
|
1377
|
-
action => $('tr', undefined, $('td', undefined, action.title), $('td', undefined, $('code', undefined, action.kind)), $('td', undefined, action.description ?? ''), $('td', undefined, ...( action.languages.map(language => $('code', undefined, language)))))
|
|
1378
|
-
))));
|
|
1379
|
-
append(container, details);
|
|
1380
|
-
return true;
|
|
1381
|
-
}
|
|
1382
|
-
renderAuthentication(container, manifest, onDetailsToggle) {
|
|
1383
|
-
const authentication = manifest.contributes?.authentication || [];
|
|
1384
|
-
if (!authentication.length) {
|
|
1385
|
-
return false;
|
|
1386
|
-
}
|
|
1387
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1388
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1389
|
-
'authentication',
|
|
1390
|
-
"Authentication ({0})",
|
|
1391
|
-
authentication.length
|
|
1392
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1393
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1394
|
-
'authentication.label',
|
|
1395
|
-
"Label"
|
|
1396
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1397
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1398
|
-
'authentication.id',
|
|
1399
|
-
"ID"
|
|
1400
|
-
)))), ...( authentication
|
|
1401
|
-
.sort((a, b) => a.label.localeCompare(b.label))
|
|
1402
|
-
.map(
|
|
1403
|
-
action => $('tr', undefined, $('td', undefined, action.label), $('td', undefined, action.id))
|
|
1404
|
-
))));
|
|
1405
|
-
append(container, details);
|
|
1406
|
-
return true;
|
|
1407
|
-
}
|
|
1408
|
-
renderColorThemes(container, manifest, onDetailsToggle) {
|
|
1409
|
-
const contrib = manifest.contributes?.themes || [];
|
|
1410
|
-
if (!contrib.length) {
|
|
1411
|
-
return false;
|
|
1412
|
-
}
|
|
1413
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1414
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1415
|
-
'colorThemes',
|
|
1416
|
-
"Color Themes ({0})",
|
|
1417
|
-
contrib.length
|
|
1418
|
-
))), $('ul', undefined, ...( contrib
|
|
1419
|
-
.sort((a, b) => a.label.localeCompare(b.label))
|
|
1420
|
-
.map(theme => $('li', undefined, theme.label)))));
|
|
1421
|
-
append(container, details);
|
|
1422
|
-
return true;
|
|
1423
|
-
}
|
|
1424
|
-
renderIconThemes(container, manifest, onDetailsToggle) {
|
|
1425
|
-
const contrib = manifest.contributes?.iconThemes || [];
|
|
1426
|
-
if (!contrib.length) {
|
|
1427
|
-
return false;
|
|
1428
|
-
}
|
|
1429
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1430
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1431
|
-
'iconThemes',
|
|
1432
|
-
"File Icon Themes ({0})",
|
|
1433
|
-
contrib.length
|
|
1434
|
-
))), $('ul', undefined, ...( contrib
|
|
1435
|
-
.sort((a, b) => a.label.localeCompare(b.label))
|
|
1436
|
-
.map(theme => $('li', undefined, theme.label)))));
|
|
1437
|
-
append(container, details);
|
|
1438
|
-
return true;
|
|
1439
|
-
}
|
|
1440
|
-
renderProductIconThemes(container, manifest, onDetailsToggle) {
|
|
1441
|
-
const contrib = manifest.contributes?.productIconThemes || [];
|
|
1442
|
-
if (!contrib.length) {
|
|
1443
|
-
return false;
|
|
1444
|
-
}
|
|
1445
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1446
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1447
|
-
'productThemes',
|
|
1448
|
-
"Product Icon Themes ({0})",
|
|
1449
|
-
contrib.length
|
|
1450
|
-
))), $('ul', undefined, ...( contrib
|
|
1451
|
-
.sort((a, b) => a.label.localeCompare(b.label))
|
|
1452
|
-
.map(theme => $('li', undefined, theme.label)))));
|
|
1453
|
-
append(container, details);
|
|
1454
|
-
return true;
|
|
1455
|
-
}
|
|
1456
|
-
renderColors(container, manifest, onDetailsToggle) {
|
|
1457
|
-
const colors = manifest.contributes?.colors || [];
|
|
1458
|
-
if (!colors.length) {
|
|
1459
|
-
return false;
|
|
1460
|
-
}
|
|
1461
|
-
function colorPreview(colorReference) {
|
|
1462
|
-
const result = [];
|
|
1463
|
-
if (colorReference && colorReference[0] === '#') {
|
|
1464
|
-
const color = ( Color.fromHex(colorReference));
|
|
1465
|
-
if (color) {
|
|
1466
|
-
result.push($('span', { class: 'colorBox', style: 'background-color: ' + Color.Format.CSS.format(color) }, ''));
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
result.push($('code', undefined, colorReference));
|
|
1470
|
-
return result;
|
|
1471
|
-
}
|
|
1472
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1473
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1474
|
-
'colors',
|
|
1475
|
-
"Colors ({0})",
|
|
1476
|
-
colors.length
|
|
1477
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath('vs/workbench/contrib/extensions/browser/extensionEditor', 'colorId', "ID"))), $('th', undefined, ( localizeWithPath(
|
|
1478
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1479
|
-
'description',
|
|
1480
|
-
"Description"
|
|
1481
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1482
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1483
|
-
'defaultDark',
|
|
1484
|
-
"Dark Default"
|
|
1485
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1486
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1487
|
-
'defaultLight',
|
|
1488
|
-
"Light Default"
|
|
1489
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1490
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1491
|
-
'defaultHC',
|
|
1492
|
-
"High Contrast Default"
|
|
1493
|
-
)))), ...( colors
|
|
1494
|
-
.sort((a, b) => a.id.localeCompare(b.id))
|
|
1495
|
-
.map(
|
|
1496
|
-
color => $('tr', undefined, $('td', undefined, $('code', undefined, color.id)), $('td', undefined, color.description), $('td', undefined, ...colorPreview(color.defaults.dark)), $('td', undefined, ...colorPreview(color.defaults.light)), $('td', undefined, ...colorPreview(color.defaults.highContrast)))
|
|
1497
|
-
))));
|
|
1498
|
-
append(container, details);
|
|
1499
|
-
return true;
|
|
1500
|
-
}
|
|
1501
|
-
renderJSONValidation(container, manifest, onDetailsToggle) {
|
|
1502
|
-
const contrib = manifest.contributes?.jsonValidation || [];
|
|
1503
|
-
if (!contrib.length) {
|
|
1504
|
-
return false;
|
|
1505
|
-
}
|
|
1506
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1507
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1508
|
-
'JSON Validation',
|
|
1509
|
-
"JSON Validation ({0})",
|
|
1510
|
-
contrib.length
|
|
1511
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1512
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1513
|
-
'fileMatch',
|
|
1514
|
-
"File Match"
|
|
1515
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1516
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1517
|
-
'schema',
|
|
1518
|
-
"Schema"
|
|
1519
|
-
)))), ...( contrib.map(
|
|
1520
|
-
v => $('tr', undefined, $('td', undefined, $('code', undefined, Array.isArray(v.fileMatch) ? v.fileMatch.join(', ') : v.fileMatch)), $('td', undefined, v.url))
|
|
1521
|
-
))));
|
|
1522
|
-
append(container, details);
|
|
1523
|
-
return true;
|
|
1524
|
-
}
|
|
1525
|
-
renderCommands(container, manifest, onDetailsToggle) {
|
|
1526
|
-
const rawCommands = manifest.contributes?.commands || [];
|
|
1527
|
-
const commands = ( rawCommands.map(c => ({
|
|
1528
|
-
id: c.command,
|
|
1529
|
-
title: c.title,
|
|
1530
|
-
keybindings: [],
|
|
1531
|
-
menus: []
|
|
1532
|
-
})));
|
|
1533
|
-
const byId = index(commands, c => c.id);
|
|
1534
|
-
const menus = manifest.contributes?.menus || {};
|
|
1535
|
-
for (const context in menus) {
|
|
1536
|
-
for (const menu of menus[context]) {
|
|
1537
|
-
if (menu.command) {
|
|
1538
|
-
let command = byId[menu.command];
|
|
1539
|
-
if (command) {
|
|
1540
|
-
command.menus.push(context);
|
|
1541
|
-
}
|
|
1542
|
-
else {
|
|
1543
|
-
command = { id: menu.command, title: '', keybindings: [], menus: [context] };
|
|
1544
|
-
byId[command.id] = command;
|
|
1545
|
-
commands.push(command);
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
const rawKeybindings = manifest.contributes?.keybindings ? (Array.isArray(manifest.contributes.keybindings) ? manifest.contributes.keybindings : [manifest.contributes.keybindings]) : [];
|
|
1551
|
-
rawKeybindings.forEach(rawKeybinding => {
|
|
1552
|
-
const keybinding = this.resolveKeybinding(rawKeybinding);
|
|
1553
|
-
if (!keybinding) {
|
|
1554
|
-
return;
|
|
1555
|
-
}
|
|
1556
|
-
let command = byId[rawKeybinding.command];
|
|
1557
|
-
if (command) {
|
|
1558
|
-
command.keybindings.push(keybinding);
|
|
1559
|
-
}
|
|
1560
|
-
else {
|
|
1561
|
-
command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] };
|
|
1562
|
-
byId[command.id] = command;
|
|
1563
|
-
commands.push(command);
|
|
1564
|
-
}
|
|
1565
|
-
});
|
|
1566
|
-
if (!commands.length) {
|
|
1567
|
-
return false;
|
|
1568
|
-
}
|
|
1569
|
-
const renderKeybinding = (keybinding) => {
|
|
1570
|
-
const element = $('');
|
|
1571
|
-
const kbl = ( new KeybindingLabel(element, OS, defaultKeybindingLabelStyles));
|
|
1572
|
-
kbl.set(keybinding);
|
|
1573
|
-
return element;
|
|
1574
|
-
};
|
|
1575
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1576
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1577
|
-
'commands',
|
|
1578
|
-
"Commands ({0})",
|
|
1579
|
-
commands.length
|
|
1580
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1581
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1582
|
-
'command name',
|
|
1583
|
-
"ID"
|
|
1584
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1585
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1586
|
-
'command title',
|
|
1587
|
-
"Title"
|
|
1588
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1589
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1590
|
-
'keyboard shortcuts',
|
|
1591
|
-
"Keyboard Shortcuts"
|
|
1592
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1593
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1594
|
-
'menuContexts',
|
|
1595
|
-
"Menu Contexts"
|
|
1596
|
-
)))), ...( commands
|
|
1597
|
-
.sort((a, b) => a.id.localeCompare(b.id))
|
|
1598
|
-
.map(
|
|
1599
|
-
c => $('tr', undefined, $('td', undefined, $('code', undefined, c.id)), $('td', undefined, typeof c.title === 'string' ? c.title : c.title.value), $('td', undefined, ...( c.keybindings.map(keybinding => renderKeybinding(keybinding)))), $('td', undefined, ...( c.menus.map(context => $('code', undefined, context)))))
|
|
1600
|
-
))));
|
|
1601
|
-
append(container, details);
|
|
1602
|
-
return true;
|
|
1603
|
-
}
|
|
1604
|
-
renderLanguages(container, manifest, onDetailsToggle) {
|
|
1605
|
-
const contributes = manifest.contributes;
|
|
1606
|
-
const rawLanguages = contributes?.languages || [];
|
|
1607
|
-
const languages = ( rawLanguages.map(l => ({
|
|
1608
|
-
id: l.id,
|
|
1609
|
-
name: (l.aliases || [])[0] || l.id,
|
|
1610
|
-
extensions: l.extensions || [],
|
|
1611
|
-
hasGrammar: false,
|
|
1612
|
-
hasSnippets: false
|
|
1613
|
-
})));
|
|
1614
|
-
const byId = index(languages, l => l.id);
|
|
1615
|
-
const grammars = contributes?.grammars || [];
|
|
1616
|
-
grammars.forEach(grammar => {
|
|
1617
|
-
let language = byId[grammar.language];
|
|
1618
|
-
if (language) {
|
|
1619
|
-
language.hasGrammar = true;
|
|
1620
|
-
}
|
|
1621
|
-
else {
|
|
1622
|
-
language = { id: grammar.language, name: grammar.language, extensions: [], hasGrammar: true, hasSnippets: false };
|
|
1623
|
-
byId[language.id] = language;
|
|
1624
|
-
languages.push(language);
|
|
1625
|
-
}
|
|
1626
|
-
});
|
|
1627
|
-
const snippets = contributes?.snippets || [];
|
|
1628
|
-
snippets.forEach(snippet => {
|
|
1629
|
-
let language = byId[snippet.language];
|
|
1630
|
-
if (language) {
|
|
1631
|
-
language.hasSnippets = true;
|
|
1632
|
-
}
|
|
1633
|
-
else {
|
|
1634
|
-
language = { id: snippet.language, name: snippet.language, extensions: [], hasGrammar: false, hasSnippets: true };
|
|
1635
|
-
byId[language.id] = language;
|
|
1636
|
-
languages.push(language);
|
|
1637
|
-
}
|
|
1638
|
-
});
|
|
1639
|
-
if (!languages.length) {
|
|
1640
|
-
return false;
|
|
1641
|
-
}
|
|
1642
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1643
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1644
|
-
'languages',
|
|
1645
|
-
"Languages ({0})",
|
|
1646
|
-
languages.length
|
|
1647
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1648
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1649
|
-
'language id',
|
|
1650
|
-
"ID"
|
|
1651
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1652
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1653
|
-
'language name',
|
|
1654
|
-
"Name"
|
|
1655
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1656
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1657
|
-
'file extensions',
|
|
1658
|
-
"File Extensions"
|
|
1659
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1660
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1661
|
-
'grammar',
|
|
1662
|
-
"Grammar"
|
|
1663
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1664
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1665
|
-
'snippets',
|
|
1666
|
-
"Snippets"
|
|
1667
|
-
)))), ...( languages
|
|
1668
|
-
.sort((a, b) => a.id.localeCompare(b.id))
|
|
1669
|
-
.map(
|
|
1670
|
-
l => $('tr', undefined, $('td', undefined, l.id), $('td', undefined, l.name), $('td', undefined, ...join(( l.extensions.map(ext => $('code', undefined, ext))), ' ')), $('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '\u2014')), $('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '\u2014')))
|
|
1671
|
-
))));
|
|
1672
|
-
append(container, details);
|
|
1673
|
-
return true;
|
|
1674
|
-
}
|
|
1675
|
-
renderActivationEvents(container, manifest, onDetailsToggle) {
|
|
1676
|
-
const activationEvents = manifest.activationEvents || [];
|
|
1677
|
-
if (!activationEvents.length) {
|
|
1678
|
-
return false;
|
|
1679
|
-
}
|
|
1680
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1681
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1682
|
-
'activation events',
|
|
1683
|
-
"Activation Events ({0})",
|
|
1684
|
-
activationEvents.length
|
|
1685
|
-
))), $('ul', undefined, ...( activationEvents
|
|
1686
|
-
.sort((a, b) => a.localeCompare(b))
|
|
1687
|
-
.map(
|
|
1688
|
-
activationEvent => $('li', undefined, $('code', undefined, activationEvent))
|
|
1689
|
-
))));
|
|
1690
|
-
append(container, details);
|
|
1691
|
-
return true;
|
|
1692
|
-
}
|
|
1693
|
-
renderNotebooks(container, manifest, onDetailsToggle) {
|
|
1694
|
-
const contrib = manifest.contributes?.notebooks || [];
|
|
1695
|
-
if (!contrib.length) {
|
|
1696
|
-
return false;
|
|
1697
|
-
}
|
|
1698
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1699
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1700
|
-
'Notebooks',
|
|
1701
|
-
"Notebooks ({0})",
|
|
1702
|
-
contrib.length
|
|
1703
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1704
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1705
|
-
'Notebook id',
|
|
1706
|
-
"ID"
|
|
1707
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1708
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1709
|
-
'Notebook name',
|
|
1710
|
-
"Name"
|
|
1711
|
-
)))), ...( contrib
|
|
1712
|
-
.sort((a, b) => a.type.localeCompare(b.type))
|
|
1713
|
-
.map(
|
|
1714
|
-
d => $('tr', undefined, $('td', undefined, d.type), $('td', undefined, d.displayName))
|
|
1715
|
-
))));
|
|
1716
|
-
append(container, details);
|
|
1717
|
-
return true;
|
|
1718
|
-
}
|
|
1719
|
-
renderNotebookRenderers(container, manifest, onDetailsToggle) {
|
|
1720
|
-
const contrib = manifest.contributes?.notebookRenderer || [];
|
|
1721
|
-
if (!contrib.length) {
|
|
1722
|
-
return false;
|
|
1723
|
-
}
|
|
1724
|
-
const details = $('details', { open: true, ontoggle: onDetailsToggle }, $('summary', { tabindex: '0' }, ( localizeWithPath(
|
|
1725
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1726
|
-
'NotebookRenderers',
|
|
1727
|
-
"Notebook Renderers ({0})",
|
|
1728
|
-
contrib.length
|
|
1729
|
-
))), $('table', undefined, $('tr', undefined, $('th', undefined, ( localizeWithPath(
|
|
1730
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1731
|
-
'Notebook renderer name',
|
|
1732
|
-
"Name"
|
|
1733
|
-
))), $('th', undefined, ( localizeWithPath(
|
|
1734
|
-
'vs/workbench/contrib/extensions/browser/extensionEditor',
|
|
1735
|
-
'Notebook mimetypes',
|
|
1736
|
-
"Mimetypes"
|
|
1737
|
-
)))), ...( contrib
|
|
1738
|
-
.sort((a, b) => a.displayName.localeCompare(b.displayName))
|
|
1739
|
-
.map(
|
|
1740
|
-
d => $('tr', undefined, $('td', undefined, d.displayName), $('td', undefined, d.mimeTypes.join(',')))
|
|
1741
|
-
))));
|
|
1742
|
-
append(container, details);
|
|
1743
|
-
return true;
|
|
1744
|
-
}
|
|
1745
|
-
resolveKeybinding(rawKeyBinding) {
|
|
1746
|
-
let key;
|
|
1747
|
-
switch (platform) {
|
|
1748
|
-
case 'win32':
|
|
1749
|
-
key = rawKeyBinding.win;
|
|
1750
|
-
break;
|
|
1751
|
-
case 'linux':
|
|
1752
|
-
key = rawKeyBinding.linux;
|
|
1753
|
-
break;
|
|
1754
|
-
case 'darwin':
|
|
1755
|
-
key = rawKeyBinding.mac;
|
|
1756
|
-
break;
|
|
1757
|
-
}
|
|
1758
|
-
return this.keybindingService.resolveUserBinding(key || rawKeyBinding.key)[0];
|
|
1759
|
-
}
|
|
1760
977
|
loadContents(loadingTask, container) {
|
|
1761
978
|
container.classList.add('loading');
|
|
1762
979
|
const result = this.contentDisposables.add(loadingTask());
|
|
@@ -1782,16 +999,15 @@ ExtensionEditor = ExtensionEditor_1 = ( __decorate([
|
|
|
1782
999
|
( __param(3, IExtensionsWorkbenchService)),
|
|
1783
1000
|
( __param(4, IExtensionGalleryService)),
|
|
1784
1001
|
( __param(5, IThemeService)),
|
|
1785
|
-
( __param(6,
|
|
1786
|
-
( __param(7,
|
|
1787
|
-
( __param(8,
|
|
1788
|
-
( __param(9,
|
|
1789
|
-
( __param(10,
|
|
1790
|
-
( __param(11,
|
|
1791
|
-
( __param(12,
|
|
1792
|
-
( __param(13,
|
|
1793
|
-
( __param(14,
|
|
1794
|
-
( __param(15, IContextKeyService))
|
|
1002
|
+
( __param(6, INotificationService)),
|
|
1003
|
+
( __param(7, IOpenerService)),
|
|
1004
|
+
( __param(8, IExtensionRecommendationsService)),
|
|
1005
|
+
( __param(9, IStorageService)),
|
|
1006
|
+
( __param(10, IExtensionService)),
|
|
1007
|
+
( __param(11, IWebviewService)),
|
|
1008
|
+
( __param(12, ILanguageService)),
|
|
1009
|
+
( __param(13, IContextMenuService)),
|
|
1010
|
+
( __param(14, IContextKeyService))
|
|
1795
1011
|
], ExtensionEditor));
|
|
1796
1012
|
const contextKeyExpr = ( ContextKeyExpr.and(( ContextKeyExpr.equals('activeEditor', ExtensionEditor.ID)), ( EditorContextKeys.focus.toNegated())));
|
|
1797
1013
|
registerAction2(class ShowExtensionEditorFindAction extends Action2 {
|