@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.
- package/extensionGallery.d.ts +12 -0
- package/extensionGallery.js +76 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +30 -0
- package/vscode/src/vs/platform/extensionManagement/common/abstractExtensionManagementService.js +784 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +142 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionGalleryService.js +855 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementIpc.js +119 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionTipsService.js +57 -0
- package/vscode/src/vs/platform/extensionManagement/common/unsupportedExtensionsMigration.js +58 -0
- package/vscode/src/vs/platform/externalServices/common/marketplace.js +17 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +492 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/browserRuntimeExtensionsEditor.js +28 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +78 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/deprecatedExtensionsChecker.js +87 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +60 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +1868 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +52 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +437 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendations.js +17 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.js +221 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +2063 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.web.contribution.js +13 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +46 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +65 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +98 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsList.js +224 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +121 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +285 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +912 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +1270 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +824 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +1730 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +324 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/keymapRecommendations.js +28 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/languageRecommendations.js +28 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extension.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionEditor.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsViewlet.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionsWidgets.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/runtimeExtensionsEditor.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.js +29 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/unsupportedExtensionsMigrationContribution.js +26 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +38 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +88 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionQuery.js +67 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +43 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +104 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/reportExtensionIssueAction.js +31 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +41 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +207 -0
- package/vscode/src/vs/workbench/contrib/update/common/update.js +3 -0
- package/vscode/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.js +84 -0
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.js +634 -0
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +883 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementChannelClient.js +109 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementServerService.js +62 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.js +633 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/remoteExtensionManagementService.js +58 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/webExtensionManagementService.js +269 -0
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService.js +83 -0
- package/vscode/src/vs/workbench/services/remote/common/remoteExtensionsScanner.js +73 -0
|
@@ -0,0 +1,824 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/extensionsWidgets.css.js';
|
|
3
|
+
import { valid } from 'vscode-semver';
|
|
4
|
+
import { Disposable, DisposableStore, MutableDisposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
+
import { IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
6
|
+
import { addDisposableListener, EventType, finalHandler, append, $, reset } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
7
|
+
import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
8
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
9
|
+
import { IExtensionManagementServerService } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionManagement';
|
|
10
|
+
import { IExtensionRecommendationsService, IExtensionIgnoredRecommendationsService } from 'vscode/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations';
|
|
11
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
12
|
+
import { extensionButtonProminentBackground } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
|
|
13
|
+
import { registerThemingParticipant, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
14
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
15
|
+
import { EXTENSION_BADGE_REMOTE_BACKGROUND, EXTENSION_BADGE_REMOTE_FOREGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
16
|
+
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
17
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
18
|
+
import { CountBadge } from 'monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js';
|
|
19
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
20
|
+
import { IUserDataSyncEnablementService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
21
|
+
import { starFullIcon, verifiedPublisherIcon, sponsorIcon, installCountIcon, starHalfIcon, starEmptyIcon, remoteIcon, ratingIcon, preReleaseIcon, syncIgnoredIcon, activationTimeIcon, errorIcon, warningIcon, infoIcon } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons';
|
|
22
|
+
import { registerColor, textLinkForeground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
23
|
+
import { IHoverService } from 'vscode/vscode/vs/workbench/services/hover/browser/hover';
|
|
24
|
+
import { MarkdownString } from 'monaco-editor/esm/vs/base/common/htmlContent.js';
|
|
25
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
26
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
27
|
+
import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
28
|
+
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
29
|
+
import { setupCustomHover } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabelHover.js';
|
|
30
|
+
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
31
|
+
import { renderMarkdown } from 'monaco-editor/esm/vs/base/browser/markdownRenderer.js';
|
|
32
|
+
import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
33
|
+
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
34
|
+
import { renderIcon } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabels.js';
|
|
35
|
+
import { StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboardEvent.js';
|
|
36
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
37
|
+
import { defaultCountBadgeStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
38
|
+
|
|
39
|
+
var ExtensionHoverWidget_1;
|
|
40
|
+
class ExtensionWidget extends Disposable {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this._extension = null;
|
|
44
|
+
}
|
|
45
|
+
get extension() { return this._extension; }
|
|
46
|
+
set extension(extension) { this._extension = extension; this.update(); }
|
|
47
|
+
update() { this.render(); }
|
|
48
|
+
}
|
|
49
|
+
function onClick(element, callback) {
|
|
50
|
+
const disposables = ( new DisposableStore());
|
|
51
|
+
disposables.add(addDisposableListener(element, EventType.CLICK, finalHandler(callback)));
|
|
52
|
+
disposables.add(addDisposableListener(element, EventType.KEY_UP, e => {
|
|
53
|
+
const keyboardEvent = ( new StandardKeyboardEvent(e));
|
|
54
|
+
if (keyboardEvent.equals(10 ) || keyboardEvent.equals(3 )) {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
callback();
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
return disposables;
|
|
61
|
+
}
|
|
62
|
+
class InstallCountWidget extends ExtensionWidget {
|
|
63
|
+
constructor(container, small) {
|
|
64
|
+
super();
|
|
65
|
+
this.container = container;
|
|
66
|
+
this.small = small;
|
|
67
|
+
container.classList.add('extension-install-count');
|
|
68
|
+
this.render();
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
this.container.innerText = '';
|
|
72
|
+
if (!this.extension) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (this.small && this.extension.state === 1 ) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const installLabel = InstallCountWidget.getInstallLabel(this.extension, this.small);
|
|
79
|
+
if (!installLabel) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
append(this.container, $('span' + ThemeIcon.asCSSSelector(installCountIcon)));
|
|
83
|
+
const count = append(this.container, $('span.count'));
|
|
84
|
+
count.textContent = installLabel;
|
|
85
|
+
}
|
|
86
|
+
static getInstallLabel(extension, small) {
|
|
87
|
+
const installCount = extension.installCount;
|
|
88
|
+
if (installCount === undefined) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
let installLabel;
|
|
92
|
+
if (small) {
|
|
93
|
+
if (installCount > 1000000) {
|
|
94
|
+
installLabel = `${Math.floor(installCount / 100000) / 10}M`;
|
|
95
|
+
}
|
|
96
|
+
else if (installCount > 1000) {
|
|
97
|
+
installLabel = `${Math.floor(installCount / 1000)}K`;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
installLabel = String(installCount);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
installLabel = installCount.toLocaleString(platform.language);
|
|
105
|
+
}
|
|
106
|
+
return installLabel;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
class RatingsWidget extends ExtensionWidget {
|
|
110
|
+
constructor(container, small) {
|
|
111
|
+
super();
|
|
112
|
+
this.container = container;
|
|
113
|
+
this.small = small;
|
|
114
|
+
container.classList.add('extension-ratings');
|
|
115
|
+
if (this.small) {
|
|
116
|
+
container.classList.add('small');
|
|
117
|
+
}
|
|
118
|
+
this.render();
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
this.container.innerText = '';
|
|
122
|
+
this.container.title = '';
|
|
123
|
+
if (!this.extension) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (this.small && this.extension.state === 1 ) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (this.extension.rating === undefined) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (this.small && !this.extension.ratingCount) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const rating = Math.round(this.extension.rating * 2) / 2;
|
|
136
|
+
this.container.title = ( localizeWithPath(
|
|
137
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
138
|
+
'ratedLabel',
|
|
139
|
+
"Average rating: {0} out of 5",
|
|
140
|
+
rating
|
|
141
|
+
));
|
|
142
|
+
if (this.small) {
|
|
143
|
+
append(this.container, $('span' + ThemeIcon.asCSSSelector(starFullIcon)));
|
|
144
|
+
const count = append(this.container, $('span.count'));
|
|
145
|
+
count.textContent = String(rating);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
for (let i = 1; i <= 5; i++) {
|
|
149
|
+
if (rating >= i) {
|
|
150
|
+
append(this.container, $('span' + ThemeIcon.asCSSSelector(starFullIcon)));
|
|
151
|
+
}
|
|
152
|
+
else if (rating >= i - 0.5) {
|
|
153
|
+
append(this.container, $('span' + ThemeIcon.asCSSSelector(starHalfIcon)));
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
append(this.container, $('span' + ThemeIcon.asCSSSelector(starEmptyIcon)));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (this.extension.ratingCount) {
|
|
160
|
+
const ratingCountElemet = append(this.container, $('span', undefined, ` (${this.extension.ratingCount})`));
|
|
161
|
+
ratingCountElemet.style.paddingLeft = '1px';
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
let VerifiedPublisherWidget = class VerifiedPublisherWidget extends ExtensionWidget {
|
|
167
|
+
constructor(container, small, openerService) {
|
|
168
|
+
super();
|
|
169
|
+
this.container = container;
|
|
170
|
+
this.small = small;
|
|
171
|
+
this.openerService = openerService;
|
|
172
|
+
this.disposables = this._register(( new DisposableStore()));
|
|
173
|
+
this.render();
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
reset(this.container);
|
|
177
|
+
this.disposables.clear();
|
|
178
|
+
if (!this.extension?.publisherDomain?.verified) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const publisherDomainLink = ( URI.parse(this.extension.publisherDomain.link));
|
|
182
|
+
const verifiedPublisher = append(this.container, $('span.extension-verified-publisher.clickable'));
|
|
183
|
+
append(verifiedPublisher, renderIcon(verifiedPublisherIcon));
|
|
184
|
+
if (!this.small) {
|
|
185
|
+
verifiedPublisher.tabIndex = 0;
|
|
186
|
+
verifiedPublisher.title = this.extension.publisherDomain.link;
|
|
187
|
+
verifiedPublisher.setAttribute('role', 'link');
|
|
188
|
+
append(verifiedPublisher, $('span.extension-verified-publisher-domain', undefined, publisherDomainLink.authority.startsWith('www.') ? publisherDomainLink.authority.substring(4) : publisherDomainLink.authority));
|
|
189
|
+
this.disposables.add(onClick(verifiedPublisher, () => this.openerService.open(publisherDomainLink)));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
VerifiedPublisherWidget = ( __decorate([
|
|
194
|
+
( __param(2, IOpenerService))
|
|
195
|
+
], VerifiedPublisherWidget));
|
|
196
|
+
let SponsorWidget = class SponsorWidget extends ExtensionWidget {
|
|
197
|
+
constructor(container, openerService, telemetryService) {
|
|
198
|
+
super();
|
|
199
|
+
this.container = container;
|
|
200
|
+
this.openerService = openerService;
|
|
201
|
+
this.telemetryService = telemetryService;
|
|
202
|
+
this.disposables = this._register(( new DisposableStore()));
|
|
203
|
+
this.render();
|
|
204
|
+
}
|
|
205
|
+
render() {
|
|
206
|
+
reset(this.container);
|
|
207
|
+
this.disposables.clear();
|
|
208
|
+
if (!this.extension?.publisherSponsorLink) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const sponsor = append(this.container, $('span.sponsor.clickable', { tabIndex: 0, title: this.extension?.publisherSponsorLink }));
|
|
212
|
+
sponsor.setAttribute('role', 'link');
|
|
213
|
+
const sponsorIconElement = renderIcon(sponsorIcon);
|
|
214
|
+
const label = $('span', undefined, ( localizeWithPath(
|
|
215
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
216
|
+
'sponsor',
|
|
217
|
+
"Sponsor"
|
|
218
|
+
)));
|
|
219
|
+
append(sponsor, sponsorIconElement, label);
|
|
220
|
+
this.disposables.add(onClick(sponsor, () => {
|
|
221
|
+
this.telemetryService.publicLog2('extensionsAction.sponsorExtension', { extensionId: this.extension.identifier.id });
|
|
222
|
+
this.openerService.open(this.extension.publisherSponsorLink);
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
SponsorWidget = ( __decorate([
|
|
227
|
+
( __param(1, IOpenerService)),
|
|
228
|
+
( __param(2, ITelemetryService))
|
|
229
|
+
], SponsorWidget));
|
|
230
|
+
let RecommendationWidget = class RecommendationWidget extends ExtensionWidget {
|
|
231
|
+
constructor(parent, extensionRecommendationsService) {
|
|
232
|
+
super();
|
|
233
|
+
this.parent = parent;
|
|
234
|
+
this.extensionRecommendationsService = extensionRecommendationsService;
|
|
235
|
+
this.disposables = this._register(( new DisposableStore()));
|
|
236
|
+
this.render();
|
|
237
|
+
this._register(toDisposable(() => this.clear()));
|
|
238
|
+
this._register(this.extensionRecommendationsService.onDidChangeRecommendations(() => this.render()));
|
|
239
|
+
}
|
|
240
|
+
clear() {
|
|
241
|
+
if (this.element) {
|
|
242
|
+
this.parent.removeChild(this.element);
|
|
243
|
+
}
|
|
244
|
+
this.element = undefined;
|
|
245
|
+
this.disposables.clear();
|
|
246
|
+
}
|
|
247
|
+
render() {
|
|
248
|
+
this.clear();
|
|
249
|
+
if (!this.extension || this.extension.state === 1 || this.extension.deprecationInfo) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const extRecommendations = this.extensionRecommendationsService.getAllRecommendationsWithReason();
|
|
253
|
+
if (extRecommendations[this.extension.identifier.id.toLowerCase()]) {
|
|
254
|
+
this.element = append(this.parent, $('div.extension-bookmark'));
|
|
255
|
+
const recommendation = append(this.element, $('.recommendation'));
|
|
256
|
+
append(recommendation, $('span' + ThemeIcon.asCSSSelector(ratingIcon)));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
RecommendationWidget = ( __decorate([
|
|
261
|
+
( __param(1, IExtensionRecommendationsService))
|
|
262
|
+
], RecommendationWidget));
|
|
263
|
+
class PreReleaseBookmarkWidget extends ExtensionWidget {
|
|
264
|
+
constructor(parent) {
|
|
265
|
+
super();
|
|
266
|
+
this.parent = parent;
|
|
267
|
+
this.disposables = this._register(( new DisposableStore()));
|
|
268
|
+
this.render();
|
|
269
|
+
this._register(toDisposable(() => this.clear()));
|
|
270
|
+
}
|
|
271
|
+
clear() {
|
|
272
|
+
if (this.element) {
|
|
273
|
+
this.parent.removeChild(this.element);
|
|
274
|
+
}
|
|
275
|
+
this.element = undefined;
|
|
276
|
+
this.disposables.clear();
|
|
277
|
+
}
|
|
278
|
+
render() {
|
|
279
|
+
this.clear();
|
|
280
|
+
if (!this.extension) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (!this.extension.hasPreReleaseVersion) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (this.extension.state === 1 && !this.extension.local?.isPreReleaseVersion) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
this.element = append(this.parent, $('div.extension-bookmark'));
|
|
290
|
+
const preRelease = append(this.element, $('.pre-release'));
|
|
291
|
+
append(preRelease, $('span' + ThemeIcon.asCSSSelector(preReleaseIcon)));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
let RemoteBadgeWidget = class RemoteBadgeWidget extends ExtensionWidget {
|
|
295
|
+
constructor(parent, tooltip, extensionManagementServerService, instantiationService) {
|
|
296
|
+
super();
|
|
297
|
+
this.tooltip = tooltip;
|
|
298
|
+
this.extensionManagementServerService = extensionManagementServerService;
|
|
299
|
+
this.instantiationService = instantiationService;
|
|
300
|
+
this.remoteBadge = this._register(( new MutableDisposable()));
|
|
301
|
+
this.element = append(parent, $('.extension-remote-badge-container'));
|
|
302
|
+
this.render();
|
|
303
|
+
this._register(toDisposable(() => this.clear()));
|
|
304
|
+
}
|
|
305
|
+
clear() {
|
|
306
|
+
if (this.remoteBadge.value) {
|
|
307
|
+
this.element.removeChild(this.remoteBadge.value.element);
|
|
308
|
+
}
|
|
309
|
+
this.remoteBadge.clear();
|
|
310
|
+
}
|
|
311
|
+
render() {
|
|
312
|
+
this.clear();
|
|
313
|
+
if (!this.extension || !this.extension.local || !this.extension.server || !(this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) || this.extension.server !== this.extensionManagementServerService.remoteExtensionManagementServer) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
this.remoteBadge.value = this.instantiationService.createInstance(RemoteBadge, this.tooltip);
|
|
317
|
+
append(this.element, this.remoteBadge.value.element);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
RemoteBadgeWidget = ( __decorate([
|
|
321
|
+
( __param(2, IExtensionManagementServerService)),
|
|
322
|
+
( __param(3, IInstantiationService))
|
|
323
|
+
], RemoteBadgeWidget));
|
|
324
|
+
let RemoteBadge = class RemoteBadge extends Disposable {
|
|
325
|
+
constructor(tooltip, labelService, themeService, extensionManagementServerService) {
|
|
326
|
+
super();
|
|
327
|
+
this.tooltip = tooltip;
|
|
328
|
+
this.labelService = labelService;
|
|
329
|
+
this.themeService = themeService;
|
|
330
|
+
this.extensionManagementServerService = extensionManagementServerService;
|
|
331
|
+
this.element = $('div.extension-badge.extension-remote-badge');
|
|
332
|
+
this.render();
|
|
333
|
+
}
|
|
334
|
+
render() {
|
|
335
|
+
append(this.element, $('span' + ThemeIcon.asCSSSelector(remoteIcon)));
|
|
336
|
+
const applyBadgeStyle = () => {
|
|
337
|
+
if (!this.element) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const bgColor = this.themeService.getColorTheme().getColor(EXTENSION_BADGE_REMOTE_BACKGROUND);
|
|
341
|
+
const fgColor = this.themeService.getColorTheme().getColor(EXTENSION_BADGE_REMOTE_FOREGROUND);
|
|
342
|
+
this.element.style.backgroundColor = bgColor ? ( bgColor.toString()) : '';
|
|
343
|
+
this.element.style.color = fgColor ? ( fgColor.toString()) : '';
|
|
344
|
+
};
|
|
345
|
+
applyBadgeStyle();
|
|
346
|
+
this._register(this.themeService.onDidColorThemeChange(() => applyBadgeStyle()));
|
|
347
|
+
if (this.tooltip) {
|
|
348
|
+
const updateTitle = () => {
|
|
349
|
+
if (this.element && this.extensionManagementServerService.remoteExtensionManagementServer) {
|
|
350
|
+
this.element.title = ( localizeWithPath(
|
|
351
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
352
|
+
'remote extension title',
|
|
353
|
+
"Extension in {0}",
|
|
354
|
+
this.extensionManagementServerService.remoteExtensionManagementServer.label
|
|
355
|
+
));
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
this._register(this.labelService.onDidChangeFormatters(() => updateTitle()));
|
|
359
|
+
updateTitle();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
RemoteBadge = ( __decorate([
|
|
364
|
+
( __param(1, ILabelService)),
|
|
365
|
+
( __param(2, IThemeService)),
|
|
366
|
+
( __param(3, IExtensionManagementServerService))
|
|
367
|
+
], RemoteBadge));
|
|
368
|
+
class ExtensionPackCountWidget extends ExtensionWidget {
|
|
369
|
+
constructor(parent) {
|
|
370
|
+
super();
|
|
371
|
+
this.parent = parent;
|
|
372
|
+
this.render();
|
|
373
|
+
this._register(toDisposable(() => this.clear()));
|
|
374
|
+
}
|
|
375
|
+
clear() {
|
|
376
|
+
this.element?.remove();
|
|
377
|
+
}
|
|
378
|
+
render() {
|
|
379
|
+
this.clear();
|
|
380
|
+
if (!this.extension || !(this.extension.categories?.some(category => category.toLowerCase() === 'extension packs')) || !this.extension.extensionPack.length) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
this.element = append(this.parent, $('.extension-badge.extension-pack-badge'));
|
|
384
|
+
const countBadge = ( new CountBadge(this.element, {}, defaultCountBadgeStyles));
|
|
385
|
+
countBadge.setCount(this.extension.extensionPack.length);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
let SyncIgnoredWidget = class SyncIgnoredWidget extends ExtensionWidget {
|
|
389
|
+
constructor(container, configurationService, extensionsWorkbenchService, userDataSyncEnablementService) {
|
|
390
|
+
super();
|
|
391
|
+
this.container = container;
|
|
392
|
+
this.configurationService = configurationService;
|
|
393
|
+
this.extensionsWorkbenchService = extensionsWorkbenchService;
|
|
394
|
+
this.userDataSyncEnablementService = userDataSyncEnablementService;
|
|
395
|
+
this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('settingsSync.ignoredExtensions'))(() => this.render()));
|
|
396
|
+
this._register(userDataSyncEnablementService.onDidChangeEnablement(() => this.update()));
|
|
397
|
+
this.render();
|
|
398
|
+
}
|
|
399
|
+
render() {
|
|
400
|
+
this.container.innerText = '';
|
|
401
|
+
if (this.extension && this.extension.state === 1 && this.userDataSyncEnablementService.isEnabled() && this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension)) {
|
|
402
|
+
const element = append(this.container, $('span.extension-sync-ignored' + ThemeIcon.asCSSSelector(syncIgnoredIcon)));
|
|
403
|
+
element.title = ( localizeWithPath(
|
|
404
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
405
|
+
'syncingore.label',
|
|
406
|
+
"This extension is ignored during sync."
|
|
407
|
+
));
|
|
408
|
+
element.classList.add(...ThemeIcon.asClassNameArray(syncIgnoredIcon));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
SyncIgnoredWidget = ( __decorate([
|
|
413
|
+
( __param(1, IConfigurationService)),
|
|
414
|
+
( __param(2, IExtensionsWorkbenchService)),
|
|
415
|
+
( __param(3, IUserDataSyncEnablementService))
|
|
416
|
+
], SyncIgnoredWidget));
|
|
417
|
+
let ExtensionActivationStatusWidget = class ExtensionActivationStatusWidget extends ExtensionWidget {
|
|
418
|
+
constructor(container, small, extensionService, extensionsWorkbenchService) {
|
|
419
|
+
super();
|
|
420
|
+
this.container = container;
|
|
421
|
+
this.small = small;
|
|
422
|
+
this.extensionsWorkbenchService = extensionsWorkbenchService;
|
|
423
|
+
this._register(extensionService.onDidChangeExtensionsStatus(extensions => {
|
|
424
|
+
if (this.extension && ( extensions.some(e => areSameExtensions({ id: e.value }, this.extension.identifier)))) {
|
|
425
|
+
this.update();
|
|
426
|
+
}
|
|
427
|
+
}));
|
|
428
|
+
}
|
|
429
|
+
render() {
|
|
430
|
+
this.container.innerText = '';
|
|
431
|
+
if (!this.extension) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
const extensionStatus = this.extensionsWorkbenchService.getExtensionStatus(this.extension);
|
|
435
|
+
if (!extensionStatus || !extensionStatus.activationTimes) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
const activationTime = extensionStatus.activationTimes.codeLoadingTime + extensionStatus.activationTimes.activateCallTime;
|
|
439
|
+
if (this.small) {
|
|
440
|
+
append(this.container, $('span' + ThemeIcon.asCSSSelector(activationTimeIcon)));
|
|
441
|
+
const activationTimeElement = append(this.container, $('span.activationTime'));
|
|
442
|
+
activationTimeElement.textContent = `${activationTime}ms`;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
const activationTimeElement = append(this.container, $('span.activationTime'));
|
|
446
|
+
activationTimeElement.textContent = `${( localizeWithPath(
|
|
447
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
448
|
+
'activation',
|
|
449
|
+
"Activation time"
|
|
450
|
+
))}${extensionStatus.activationTimes.activationReason.startup ? ` (${( localizeWithPath(
|
|
451
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
452
|
+
'startup',
|
|
453
|
+
"Startup"
|
|
454
|
+
))})` : ''} : ${activationTime}ms`;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
ExtensionActivationStatusWidget = ( __decorate([
|
|
459
|
+
( __param(2, IExtensionService)),
|
|
460
|
+
( __param(3, IExtensionsWorkbenchService))
|
|
461
|
+
], ExtensionActivationStatusWidget));
|
|
462
|
+
let ExtensionHoverWidget = ExtensionHoverWidget_1 = class ExtensionHoverWidget extends ExtensionWidget {
|
|
463
|
+
constructor(options, extensionStatusAction, extensionsWorkbenchService, hoverService, configurationService, extensionRecommendationsService, themeService) {
|
|
464
|
+
super();
|
|
465
|
+
this.options = options;
|
|
466
|
+
this.extensionStatusAction = extensionStatusAction;
|
|
467
|
+
this.extensionsWorkbenchService = extensionsWorkbenchService;
|
|
468
|
+
this.hoverService = hoverService;
|
|
469
|
+
this.configurationService = configurationService;
|
|
470
|
+
this.extensionRecommendationsService = extensionRecommendationsService;
|
|
471
|
+
this.themeService = themeService;
|
|
472
|
+
this.hover = this._register(( new MutableDisposable()));
|
|
473
|
+
}
|
|
474
|
+
render() {
|
|
475
|
+
this.hover.value = undefined;
|
|
476
|
+
if (this.extension) {
|
|
477
|
+
this.hover.value = setupCustomHover({
|
|
478
|
+
delay: this.configurationService.getValue('workbench.hover.delay'),
|
|
479
|
+
showHover: (options) => {
|
|
480
|
+
return this.hoverService.showHover({
|
|
481
|
+
...options,
|
|
482
|
+
hoverPosition: this.options.position(),
|
|
483
|
+
forcePosition: true,
|
|
484
|
+
additionalClasses: ['extension-hover']
|
|
485
|
+
});
|
|
486
|
+
},
|
|
487
|
+
placement: 'element'
|
|
488
|
+
}, this.options.target, { markdown: () => Promise.resolve(this.getHoverMarkdown()), markdownNotSupportedFallback: undefined });
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
getHoverMarkdown() {
|
|
492
|
+
if (!this.extension) {
|
|
493
|
+
return undefined;
|
|
494
|
+
}
|
|
495
|
+
const markdown = ( new MarkdownString('', { isTrusted: true, supportThemeIcons: true }));
|
|
496
|
+
markdown.appendMarkdown(`**${this.extension.displayName}**`);
|
|
497
|
+
if (valid(this.extension.version)) {
|
|
498
|
+
markdown.appendMarkdown(` <span style="background-color:#8080802B;">** _v${this.extension.version}_** </span>`);
|
|
499
|
+
}
|
|
500
|
+
if (this.extension.state === 1 ? this.extension.local?.isPreReleaseVersion : this.extension.gallery?.properties.isPreReleaseVersion) {
|
|
501
|
+
const extensionPreReleaseIcon = this.themeService.getColorTheme().getColor(extensionPreReleaseIconColor);
|
|
502
|
+
markdown.appendMarkdown(`** ** <span style="color:#ffffff;background-color:${extensionPreReleaseIcon ? Color.Format.CSS.formatHex(extensionPreReleaseIcon) : '#ffffff'};"> $(${preReleaseIcon.id}) ${( localizeWithPath(
|
|
503
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
504
|
+
'pre-release-label',
|
|
505
|
+
"Pre-Release"
|
|
506
|
+
))} </span>`);
|
|
507
|
+
}
|
|
508
|
+
markdown.appendText(`\n`);
|
|
509
|
+
if (this.extension.state === 1 ) {
|
|
510
|
+
let addSeparator = false;
|
|
511
|
+
const installLabel = InstallCountWidget.getInstallLabel(this.extension, true);
|
|
512
|
+
if (installLabel) {
|
|
513
|
+
if (addSeparator) {
|
|
514
|
+
markdown.appendText(` | `);
|
|
515
|
+
}
|
|
516
|
+
markdown.appendMarkdown(`$(${installCountIcon.id}) ${installLabel}`);
|
|
517
|
+
addSeparator = true;
|
|
518
|
+
}
|
|
519
|
+
if (this.extension.rating) {
|
|
520
|
+
if (addSeparator) {
|
|
521
|
+
markdown.appendText(` | `);
|
|
522
|
+
}
|
|
523
|
+
const rating = Math.round(this.extension.rating * 2) / 2;
|
|
524
|
+
markdown.appendMarkdown(`$(${starFullIcon.id}) [${rating}](${this.extension.url}&ssr=false#review-details)`);
|
|
525
|
+
addSeparator = true;
|
|
526
|
+
}
|
|
527
|
+
if (this.extension.publisherSponsorLink) {
|
|
528
|
+
if (addSeparator) {
|
|
529
|
+
markdown.appendText(` | `);
|
|
530
|
+
}
|
|
531
|
+
markdown.appendMarkdown(`$(${sponsorIcon.id}) [${( localizeWithPath(
|
|
532
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
533
|
+
'sponsor',
|
|
534
|
+
"Sponsor"
|
|
535
|
+
))}](${this.extension.publisherSponsorLink})`);
|
|
536
|
+
addSeparator = true;
|
|
537
|
+
}
|
|
538
|
+
if (addSeparator) {
|
|
539
|
+
markdown.appendText(`\n`);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
if (this.extension.description) {
|
|
543
|
+
markdown.appendMarkdown(`${this.extension.description}`);
|
|
544
|
+
markdown.appendText(`\n`);
|
|
545
|
+
}
|
|
546
|
+
if (this.extension.publisherDomain?.verified) {
|
|
547
|
+
const bgColor = this.themeService.getColorTheme().getColor(extensionVerifiedPublisherIconColor);
|
|
548
|
+
const publisherVerifiedTooltip = ( localizeWithPath(
|
|
549
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
550
|
+
'publisher verified tooltip',
|
|
551
|
+
"This publisher has verified ownership of {0}",
|
|
552
|
+
`[${( URI.parse(this.extension.publisherDomain.link)).authority}](${this.extension.publisherDomain.link})`
|
|
553
|
+
));
|
|
554
|
+
markdown.appendMarkdown(`<span style="color:${bgColor ? Color.Format.CSS.formatHex(bgColor) : '#ffffff'};">$(${verifiedPublisherIcon.id})</span> ${publisherVerifiedTooltip}`);
|
|
555
|
+
markdown.appendText(`\n`);
|
|
556
|
+
}
|
|
557
|
+
if (this.extension.outdated) {
|
|
558
|
+
markdown.appendMarkdown(( localizeWithPath(
|
|
559
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
560
|
+
'updateRequired',
|
|
561
|
+
"Latest version:"
|
|
562
|
+
)));
|
|
563
|
+
markdown.appendMarkdown(` <span style="background-color:#8080802B;">** _v${this.extension.latestVersion}_** </span>`);
|
|
564
|
+
markdown.appendText(`\n`);
|
|
565
|
+
}
|
|
566
|
+
const preReleaseMessage = ExtensionHoverWidget_1.getPreReleaseMessage(this.extension);
|
|
567
|
+
const extensionRuntimeStatus = this.extensionsWorkbenchService.getExtensionStatus(this.extension);
|
|
568
|
+
const extensionStatus = this.extensionStatusAction.status;
|
|
569
|
+
const reloadRequiredMessage = this.extension.reloadRequiredStatus;
|
|
570
|
+
const recommendationMessage = this.getRecommendationMessage(this.extension);
|
|
571
|
+
if (extensionRuntimeStatus || extensionStatus || reloadRequiredMessage || recommendationMessage || preReleaseMessage) {
|
|
572
|
+
markdown.appendMarkdown(`---`);
|
|
573
|
+
markdown.appendText(`\n`);
|
|
574
|
+
if (extensionRuntimeStatus) {
|
|
575
|
+
if (extensionRuntimeStatus.activationTimes) {
|
|
576
|
+
const activationTime = extensionRuntimeStatus.activationTimes.codeLoadingTime + extensionRuntimeStatus.activationTimes.activateCallTime;
|
|
577
|
+
markdown.appendMarkdown(`${( localizeWithPath(
|
|
578
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
579
|
+
'activation',
|
|
580
|
+
"Activation time"
|
|
581
|
+
))}${extensionRuntimeStatus.activationTimes.activationReason.startup ? ` (${( localizeWithPath(
|
|
582
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
583
|
+
'startup',
|
|
584
|
+
"Startup"
|
|
585
|
+
))})` : ''}: \`${activationTime}ms\``);
|
|
586
|
+
markdown.appendText(`\n`);
|
|
587
|
+
}
|
|
588
|
+
if (extensionRuntimeStatus.runtimeErrors.length || extensionRuntimeStatus.messages.length) {
|
|
589
|
+
const hasErrors = extensionRuntimeStatus.runtimeErrors.length || ( extensionRuntimeStatus.messages.some(message => message.type === Severity.Error));
|
|
590
|
+
const hasWarnings = ( extensionRuntimeStatus.messages.some(message => message.type === Severity.Warning));
|
|
591
|
+
const errorsLink = extensionRuntimeStatus.runtimeErrors.length ? `[${extensionRuntimeStatus.runtimeErrors.length === 1 ? ( localizeWithPath(
|
|
592
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
593
|
+
'uncaught error',
|
|
594
|
+
'1 uncaught error'
|
|
595
|
+
)) : ( localizeWithPath(
|
|
596
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
597
|
+
'uncaught errors',
|
|
598
|
+
'{0} uncaught errors',
|
|
599
|
+
extensionRuntimeStatus.runtimeErrors.length
|
|
600
|
+
))}](${( URI.parse(
|
|
601
|
+
`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id, "runtimeStatus" ]))}`
|
|
602
|
+
))})` : undefined;
|
|
603
|
+
const messageLink = extensionRuntimeStatus.messages.length ? `[${extensionRuntimeStatus.messages.length === 1 ? ( localizeWithPath(
|
|
604
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
605
|
+
'message',
|
|
606
|
+
'1 message'
|
|
607
|
+
)) : ( localizeWithPath(
|
|
608
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
609
|
+
'messages',
|
|
610
|
+
'{0} messages',
|
|
611
|
+
extensionRuntimeStatus.messages.length
|
|
612
|
+
))}](${( URI.parse(
|
|
613
|
+
`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id, "runtimeStatus" ]))}`
|
|
614
|
+
))})` : undefined;
|
|
615
|
+
markdown.appendMarkdown(`$(${hasErrors ? errorIcon.id : hasWarnings ? warningIcon.id : infoIcon.id}) This extension has reported `);
|
|
616
|
+
if (errorsLink && messageLink) {
|
|
617
|
+
markdown.appendMarkdown(`${errorsLink} and ${messageLink}`);
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
markdown.appendMarkdown(`${errorsLink || messageLink}`);
|
|
621
|
+
}
|
|
622
|
+
markdown.appendText(`\n`);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
if (extensionStatus) {
|
|
626
|
+
if (extensionStatus.icon) {
|
|
627
|
+
markdown.appendMarkdown(`$(${extensionStatus.icon.id}) `);
|
|
628
|
+
}
|
|
629
|
+
markdown.appendMarkdown(extensionStatus.message.value);
|
|
630
|
+
if (this.extension.enablementState === 5 && this.extension.local) {
|
|
631
|
+
markdown.appendMarkdown(` [${( localizeWithPath(
|
|
632
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
633
|
+
'dependencies',
|
|
634
|
+
"Show Dependencies"
|
|
635
|
+
))}](${( URI.parse(
|
|
636
|
+
`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id, "dependencies" ]))}`
|
|
637
|
+
))})`);
|
|
638
|
+
}
|
|
639
|
+
markdown.appendText(`\n`);
|
|
640
|
+
}
|
|
641
|
+
if (reloadRequiredMessage) {
|
|
642
|
+
markdown.appendMarkdown(`$(${infoIcon.id}) `);
|
|
643
|
+
markdown.appendMarkdown(`${reloadRequiredMessage}`);
|
|
644
|
+
markdown.appendText(`\n`);
|
|
645
|
+
}
|
|
646
|
+
if (preReleaseMessage) {
|
|
647
|
+
const extensionPreReleaseIcon = this.themeService.getColorTheme().getColor(extensionPreReleaseIconColor);
|
|
648
|
+
markdown.appendMarkdown(`<span style="color:${extensionPreReleaseIcon ? Color.Format.CSS.formatHex(extensionPreReleaseIcon) : '#ffffff'};">$(${preReleaseIcon.id})</span> ${preReleaseMessage}`);
|
|
649
|
+
markdown.appendText(`\n`);
|
|
650
|
+
}
|
|
651
|
+
if (recommendationMessage) {
|
|
652
|
+
markdown.appendMarkdown(recommendationMessage);
|
|
653
|
+
markdown.appendText(`\n`);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
return markdown;
|
|
657
|
+
}
|
|
658
|
+
getRecommendationMessage(extension) {
|
|
659
|
+
if (extension.state === 1 ) {
|
|
660
|
+
return undefined;
|
|
661
|
+
}
|
|
662
|
+
if (extension.deprecationInfo) {
|
|
663
|
+
return undefined;
|
|
664
|
+
}
|
|
665
|
+
const recommendation = this.extensionRecommendationsService.getAllRecommendationsWithReason()[extension.identifier.id.toLowerCase()];
|
|
666
|
+
if (!recommendation?.reasonText) {
|
|
667
|
+
return undefined;
|
|
668
|
+
}
|
|
669
|
+
const bgColor = this.themeService.getColorTheme().getColor(extensionButtonProminentBackground);
|
|
670
|
+
return `<span style="color:${bgColor ? Color.Format.CSS.formatHex(bgColor) : '#ffffff'};">$(${starEmptyIcon.id})</span> ${recommendation.reasonText}`;
|
|
671
|
+
}
|
|
672
|
+
static getPreReleaseMessage(extension) {
|
|
673
|
+
if (!extension.hasPreReleaseVersion) {
|
|
674
|
+
return undefined;
|
|
675
|
+
}
|
|
676
|
+
if (extension.isBuiltin) {
|
|
677
|
+
return undefined;
|
|
678
|
+
}
|
|
679
|
+
if (extension.local?.isPreReleaseVersion || extension.gallery?.properties.isPreReleaseVersion) {
|
|
680
|
+
return undefined;
|
|
681
|
+
}
|
|
682
|
+
const preReleaseVersionLink = `[${( localizeWithPath(
|
|
683
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
684
|
+
'Show prerelease version',
|
|
685
|
+
"Pre-Release version"
|
|
686
|
+
))}](${( URI.parse(
|
|
687
|
+
`command:workbench.extensions.action.showPreReleaseVersion?${encodeURIComponent(JSON.stringify([extension.identifier.id]))}`
|
|
688
|
+
))})`;
|
|
689
|
+
return ( localizeWithPath(
|
|
690
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
691
|
+
'has prerelease',
|
|
692
|
+
"This extension has a {0} available",
|
|
693
|
+
preReleaseVersionLink
|
|
694
|
+
));
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
ExtensionHoverWidget = ExtensionHoverWidget_1 = ( __decorate([
|
|
698
|
+
( __param(2, IExtensionsWorkbenchService)),
|
|
699
|
+
( __param(3, IHoverService)),
|
|
700
|
+
( __param(4, IConfigurationService)),
|
|
701
|
+
( __param(5, IExtensionRecommendationsService)),
|
|
702
|
+
( __param(6, IThemeService))
|
|
703
|
+
], ExtensionHoverWidget));
|
|
704
|
+
let ExtensionStatusWidget = class ExtensionStatusWidget extends ExtensionWidget {
|
|
705
|
+
constructor(container, extensionStatusAction, openerService) {
|
|
706
|
+
super();
|
|
707
|
+
this.container = container;
|
|
708
|
+
this.extensionStatusAction = extensionStatusAction;
|
|
709
|
+
this.openerService = openerService;
|
|
710
|
+
this.renderDisposables = this._register(( new DisposableStore()));
|
|
711
|
+
this._onDidRender = this._register(( new Emitter()));
|
|
712
|
+
this.onDidRender = this._onDidRender.event;
|
|
713
|
+
this.render();
|
|
714
|
+
this._register(extensionStatusAction.onDidChangeStatus(() => this.render()));
|
|
715
|
+
}
|
|
716
|
+
render() {
|
|
717
|
+
reset(this.container);
|
|
718
|
+
const extensionStatus = this.extensionStatusAction.status;
|
|
719
|
+
if (extensionStatus) {
|
|
720
|
+
const markdown = ( new MarkdownString('', { isTrusted: true, supportThemeIcons: true }));
|
|
721
|
+
if (extensionStatus.icon) {
|
|
722
|
+
markdown.appendMarkdown(`$(${extensionStatus.icon.id}) `);
|
|
723
|
+
}
|
|
724
|
+
markdown.appendMarkdown(extensionStatus.message.value);
|
|
725
|
+
const rendered = this.renderDisposables.add(renderMarkdown(markdown, {
|
|
726
|
+
actionHandler: {
|
|
727
|
+
callback: (content) => {
|
|
728
|
+
this.openerService.open(content, { allowCommands: true }).catch(onUnexpectedError);
|
|
729
|
+
},
|
|
730
|
+
disposables: this.renderDisposables
|
|
731
|
+
}
|
|
732
|
+
}));
|
|
733
|
+
append(this.container, rendered.element);
|
|
734
|
+
}
|
|
735
|
+
this._onDidRender.fire();
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
ExtensionStatusWidget = ( __decorate([
|
|
739
|
+
( __param(2, IOpenerService))
|
|
740
|
+
], ExtensionStatusWidget));
|
|
741
|
+
let ExtensionRecommendationWidget = class ExtensionRecommendationWidget extends ExtensionWidget {
|
|
742
|
+
constructor(container, extensionRecommendationsService, extensionIgnoredRecommendationsService) {
|
|
743
|
+
super();
|
|
744
|
+
this.container = container;
|
|
745
|
+
this.extensionRecommendationsService = extensionRecommendationsService;
|
|
746
|
+
this.extensionIgnoredRecommendationsService = extensionIgnoredRecommendationsService;
|
|
747
|
+
this._onDidRender = this._register(( new Emitter()));
|
|
748
|
+
this.onDidRender = this._onDidRender.event;
|
|
749
|
+
this.render();
|
|
750
|
+
this._register(this.extensionRecommendationsService.onDidChangeRecommendations(() => this.render()));
|
|
751
|
+
}
|
|
752
|
+
render() {
|
|
753
|
+
reset(this.container);
|
|
754
|
+
const recommendationStatus = this.getRecommendationStatus();
|
|
755
|
+
if (recommendationStatus) {
|
|
756
|
+
if (recommendationStatus.icon) {
|
|
757
|
+
append(this.container, $(`div${ThemeIcon.asCSSSelector(recommendationStatus.icon)}`));
|
|
758
|
+
}
|
|
759
|
+
append(this.container, $(`div.recommendation-text`, undefined, recommendationStatus.message));
|
|
760
|
+
}
|
|
761
|
+
this._onDidRender.fire();
|
|
762
|
+
}
|
|
763
|
+
getRecommendationStatus() {
|
|
764
|
+
if (!this.extension
|
|
765
|
+
|| this.extension.deprecationInfo
|
|
766
|
+
|| this.extension.state === 1 ) {
|
|
767
|
+
return undefined;
|
|
768
|
+
}
|
|
769
|
+
const extRecommendations = this.extensionRecommendationsService.getAllRecommendationsWithReason();
|
|
770
|
+
if (extRecommendations[this.extension.identifier.id.toLowerCase()]) {
|
|
771
|
+
const reasonText = extRecommendations[this.extension.identifier.id.toLowerCase()].reasonText;
|
|
772
|
+
if (reasonText) {
|
|
773
|
+
return { icon: starEmptyIcon, message: reasonText };
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
else if (this.extensionIgnoredRecommendationsService.globalIgnoredRecommendations.indexOf(this.extension.identifier.id.toLowerCase()) !== -1) {
|
|
777
|
+
return { icon: undefined, message: ( localizeWithPath(
|
|
778
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
779
|
+
'recommendationHasBeenIgnored',
|
|
780
|
+
"You have chosen not to receive recommendations for this extension."
|
|
781
|
+
)) };
|
|
782
|
+
}
|
|
783
|
+
return undefined;
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
ExtensionRecommendationWidget = ( __decorate([
|
|
787
|
+
( __param(1, IExtensionRecommendationsService)),
|
|
788
|
+
( __param(2, IExtensionIgnoredRecommendationsService))
|
|
789
|
+
], ExtensionRecommendationWidget));
|
|
790
|
+
const extensionRatingIconColor = registerColor('extensionIcon.starForeground', { light: '#DF6100', dark: '#FF8E00', hcDark: '#FF8E00', hcLight: textLinkForeground }, ( localizeWithPath(
|
|
791
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
792
|
+
'extensionIconStarForeground',
|
|
793
|
+
"The icon color for extension ratings."
|
|
794
|
+
)), true);
|
|
795
|
+
const extensionVerifiedPublisherIconColor = registerColor('extensionIcon.verifiedForeground', { dark: textLinkForeground, light: textLinkForeground, hcDark: textLinkForeground, hcLight: textLinkForeground }, ( localizeWithPath(
|
|
796
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
797
|
+
'extensionIconVerifiedForeground',
|
|
798
|
+
"The icon color for extension verified publisher."
|
|
799
|
+
)), true);
|
|
800
|
+
const extensionPreReleaseIconColor = registerColor('extensionIcon.preReleaseForeground', { dark: '#1d9271', light: '#1d9271', hcDark: '#1d9271', hcLight: textLinkForeground }, ( localizeWithPath(
|
|
801
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
802
|
+
'extensionPreReleaseForeground',
|
|
803
|
+
"The icon color for pre-release extension."
|
|
804
|
+
)), true);
|
|
805
|
+
registerColor('extensionIcon.sponsorForeground', { light: '#B51E78', dark: '#D758B3', hcDark: null, hcLight: '#B51E78' }, ( localizeWithPath(
|
|
806
|
+
'vs/workbench/contrib/extensions/browser/extensionsWidgets',
|
|
807
|
+
'extensionIcon.sponsorForeground',
|
|
808
|
+
"The icon color for extension sponsor."
|
|
809
|
+
)), true);
|
|
810
|
+
registerThemingParticipant((theme, collector) => {
|
|
811
|
+
const extensionRatingIcon = theme.getColor(extensionRatingIconColor);
|
|
812
|
+
if (extensionRatingIcon) {
|
|
813
|
+
collector.addRule(`.extension-ratings .codicon-extensions-star-full, .extension-ratings .codicon-extensions-star-half { color: ${extensionRatingIcon}; }`);
|
|
814
|
+
collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(starFullIcon)} { color: ${extensionRatingIcon}; }`);
|
|
815
|
+
}
|
|
816
|
+
const extensionVerifiedPublisherIcon = theme.getColor(extensionVerifiedPublisherIconColor);
|
|
817
|
+
if (extensionVerifiedPublisherIcon) {
|
|
818
|
+
collector.addRule(`${ThemeIcon.asCSSSelector(verifiedPublisherIcon)} { color: ${extensionVerifiedPublisherIcon}; }`);
|
|
819
|
+
}
|
|
820
|
+
collector.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${ThemeIcon.asCSSSelector(sponsorIcon)} { color: var(--vscode-extensionIcon-sponsorForeground); }`);
|
|
821
|
+
collector.addRule(`.extension-editor > .header > .details > .subtitle .sponsor ${ThemeIcon.asCSSSelector(sponsorIcon)} { color: var(--vscode-extensionIcon-sponsorForeground); }`);
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
export { ExtensionActivationStatusWidget, ExtensionHoverWidget, ExtensionPackCountWidget, ExtensionRecommendationWidget, ExtensionStatusWidget, ExtensionWidget, InstallCountWidget, PreReleaseBookmarkWidget, RatingsWidget, RecommendationWidget, RemoteBadgeWidget, SponsorWidget, SyncIgnoredWidget, VerifiedPublisherWidget, extensionPreReleaseIconColor, extensionRatingIconColor, extensionVerifiedPublisherIconColor, onClick };
|