@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,492 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { append, $, addDisposableListener, clearNode } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
|
|
4
|
+
import { renderLabelWithIcons } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabels.js';
|
|
5
|
+
import { Action, Separator } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
6
|
+
import { isNonEmptyArray } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
7
|
+
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
8
|
+
import { memoize } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
9
|
+
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
10
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
11
|
+
import './media/runtimeExtensionsEditor.css.js';
|
|
12
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
13
|
+
import { Categories } from 'monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js';
|
|
14
|
+
import { Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
15
|
+
import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
|
|
16
|
+
import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
17
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
18
|
+
import { ExtensionIdentifierMap } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
|
|
19
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
20
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
21
|
+
import { WorkbenchList } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
|
|
22
|
+
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
23
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
24
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
25
|
+
import { editorBackground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
26
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
27
|
+
import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
28
|
+
import { IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
29
|
+
import { RuntimeExtensionsInput } from '../common/runtimeExtensionsInput.js';
|
|
30
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
31
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
32
|
+
import { DefaultIconPath } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionManagement';
|
|
33
|
+
import { LocalWebWorkerRunningLocation } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionRunningLocation';
|
|
34
|
+
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
35
|
+
|
|
36
|
+
var AbstractRuntimeExtensionsEditor_1;
|
|
37
|
+
let AbstractRuntimeExtensionsEditor = class AbstractRuntimeExtensionsEditor extends EditorPane {
|
|
38
|
+
static { AbstractRuntimeExtensionsEditor_1 = this; }
|
|
39
|
+
static { this.ID = 'workbench.editor.runtimeExtensions'; }
|
|
40
|
+
constructor(telemetryService, themeService, contextKeyService, _extensionsWorkbenchService, _extensionService, _notificationService, _contextMenuService, _instantiationService, storageService, _labelService, _environmentService, _clipboardService) {
|
|
41
|
+
super(AbstractRuntimeExtensionsEditor_1.ID, telemetryService, themeService, storageService);
|
|
42
|
+
this._extensionsWorkbenchService = _extensionsWorkbenchService;
|
|
43
|
+
this._extensionService = _extensionService;
|
|
44
|
+
this._notificationService = _notificationService;
|
|
45
|
+
this._contextMenuService = _contextMenuService;
|
|
46
|
+
this._instantiationService = _instantiationService;
|
|
47
|
+
this._labelService = _labelService;
|
|
48
|
+
this._environmentService = _environmentService;
|
|
49
|
+
this._clipboardService = _clipboardService;
|
|
50
|
+
this._list = null;
|
|
51
|
+
this._elements = null;
|
|
52
|
+
this._updateSoon = this._register(( new RunOnceScheduler(() => this._updateExtensions(), 200)));
|
|
53
|
+
this._register(this._extensionService.onDidChangeExtensionsStatus(() => this._updateSoon.schedule()));
|
|
54
|
+
this._updateExtensions();
|
|
55
|
+
}
|
|
56
|
+
async _updateExtensions() {
|
|
57
|
+
this._elements = await this._resolveExtensions();
|
|
58
|
+
this._list?.splice(0, this._list.length, this._elements);
|
|
59
|
+
}
|
|
60
|
+
async _resolveExtensions() {
|
|
61
|
+
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
62
|
+
const extensionsDescriptions = this._extensionService.extensions.filter((extension) => {
|
|
63
|
+
return Boolean(extension.main) || Boolean(extension.browser);
|
|
64
|
+
});
|
|
65
|
+
const marketplaceMap = ( new ExtensionIdentifierMap());
|
|
66
|
+
const marketPlaceExtensions = await this._extensionsWorkbenchService.queryLocal();
|
|
67
|
+
for (const extension of marketPlaceExtensions) {
|
|
68
|
+
marketplaceMap.set(extension.identifier.id, extension);
|
|
69
|
+
}
|
|
70
|
+
const statusMap = this._extensionService.getExtensionsStatus();
|
|
71
|
+
const segments = ( new ExtensionIdentifierMap());
|
|
72
|
+
const profileInfo = this._getProfileInfo();
|
|
73
|
+
if (profileInfo) {
|
|
74
|
+
let currentStartTime = profileInfo.startTime;
|
|
75
|
+
for (let i = 0, len = profileInfo.deltas.length; i < len; i++) {
|
|
76
|
+
const id = profileInfo.ids[i];
|
|
77
|
+
const delta = profileInfo.deltas[i];
|
|
78
|
+
let extensionSegments = segments.get(id);
|
|
79
|
+
if (!extensionSegments) {
|
|
80
|
+
extensionSegments = [];
|
|
81
|
+
segments.set(id, extensionSegments);
|
|
82
|
+
}
|
|
83
|
+
extensionSegments.push(currentStartTime);
|
|
84
|
+
currentStartTime = currentStartTime + delta;
|
|
85
|
+
extensionSegments.push(currentStartTime);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
let result = [];
|
|
89
|
+
for (let i = 0, len = extensionsDescriptions.length; i < len; i++) {
|
|
90
|
+
const extensionDescription = extensionsDescriptions[i];
|
|
91
|
+
let extProfileInfo = null;
|
|
92
|
+
if (profileInfo) {
|
|
93
|
+
const extensionSegments = segments.get(extensionDescription.identifier) || [];
|
|
94
|
+
let extensionTotalTime = 0;
|
|
95
|
+
for (let j = 0, lenJ = extensionSegments.length / 2; j < lenJ; j++) {
|
|
96
|
+
const startTime = extensionSegments[2 * j];
|
|
97
|
+
const endTime = extensionSegments[2 * j + 1];
|
|
98
|
+
extensionTotalTime += (endTime - startTime);
|
|
99
|
+
}
|
|
100
|
+
extProfileInfo = {
|
|
101
|
+
segments: extensionSegments,
|
|
102
|
+
totalTime: extensionTotalTime
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
result[i] = {
|
|
106
|
+
originalIndex: i,
|
|
107
|
+
description: extensionDescription,
|
|
108
|
+
marketplaceInfo: marketplaceMap.get(extensionDescription.identifier),
|
|
109
|
+
status: statusMap[extensionDescription.identifier.value],
|
|
110
|
+
profileInfo: extProfileInfo || undefined,
|
|
111
|
+
unresponsiveProfile: this._getUnresponsiveProfile(extensionDescription.identifier)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
result = result.filter(element => element.status.activationStarted);
|
|
115
|
+
const isUnresponsive = (extension) => extension.unresponsiveProfile === profileInfo;
|
|
116
|
+
const profileTime = (extension) => extension.profileInfo?.totalTime ?? 0;
|
|
117
|
+
const activationTime = (extension) => (extension.status.activationTimes?.codeLoadingTime ?? 0) +
|
|
118
|
+
(extension.status.activationTimes?.activateCallTime ?? 0);
|
|
119
|
+
result = result.sort((a, b) => {
|
|
120
|
+
if (isUnresponsive(a) || isUnresponsive(b)) {
|
|
121
|
+
return +isUnresponsive(b) - +isUnresponsive(a);
|
|
122
|
+
}
|
|
123
|
+
else if (profileTime(a) || profileTime(b)) {
|
|
124
|
+
return profileTime(b) - profileTime(a);
|
|
125
|
+
}
|
|
126
|
+
else if (activationTime(a) || activationTime(b)) {
|
|
127
|
+
return activationTime(b) - activationTime(a);
|
|
128
|
+
}
|
|
129
|
+
return a.originalIndex - b.originalIndex;
|
|
130
|
+
});
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
createEditor(parent) {
|
|
134
|
+
parent.classList.add('runtime-extensions-editor');
|
|
135
|
+
const TEMPLATE_ID = 'runtimeExtensionElementTemplate';
|
|
136
|
+
const delegate = new class {
|
|
137
|
+
getHeight(element) {
|
|
138
|
+
return 70;
|
|
139
|
+
}
|
|
140
|
+
getTemplateId(element) {
|
|
141
|
+
return TEMPLATE_ID;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const renderer = {
|
|
145
|
+
templateId: TEMPLATE_ID,
|
|
146
|
+
renderTemplate: (root) => {
|
|
147
|
+
const element = append(root, $('.extension'));
|
|
148
|
+
const iconContainer = append(element, $('.icon-container'));
|
|
149
|
+
const icon = append(iconContainer, $('img.icon'));
|
|
150
|
+
const desc = append(element, $('div.desc'));
|
|
151
|
+
const headerContainer = append(desc, $('.header-container'));
|
|
152
|
+
const header = append(headerContainer, $('.header'));
|
|
153
|
+
const name = append(header, $('div.name'));
|
|
154
|
+
const version = append(header, $('span.version'));
|
|
155
|
+
const msgContainer = append(desc, $('div.msg'));
|
|
156
|
+
const actionbar = ( new ActionBar(desc, { animated: false }));
|
|
157
|
+
actionbar.onDidRun(({ error }) => error && this._notificationService.error(error));
|
|
158
|
+
const timeContainer = append(element, $('.time'));
|
|
159
|
+
const activationTime = append(timeContainer, $('div.activation-time'));
|
|
160
|
+
const profileTime = append(timeContainer, $('div.profile-time'));
|
|
161
|
+
const disposables = [actionbar];
|
|
162
|
+
return {
|
|
163
|
+
root,
|
|
164
|
+
element,
|
|
165
|
+
icon,
|
|
166
|
+
name,
|
|
167
|
+
version,
|
|
168
|
+
actionbar,
|
|
169
|
+
activationTime,
|
|
170
|
+
profileTime,
|
|
171
|
+
msgContainer,
|
|
172
|
+
disposables,
|
|
173
|
+
elementDisposables: [],
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
renderElement: (element, index, data) => {
|
|
177
|
+
data.elementDisposables = dispose(data.elementDisposables);
|
|
178
|
+
data.root.classList.toggle('odd', index % 2 === 1);
|
|
179
|
+
data.elementDisposables.push(addDisposableListener(data.icon, 'error', () => data.icon.src = element.marketplaceInfo?.iconUrlFallback || DefaultIconPath, { once: true }));
|
|
180
|
+
data.icon.src = element.marketplaceInfo?.iconUrl || DefaultIconPath;
|
|
181
|
+
if (!data.icon.complete) {
|
|
182
|
+
data.icon.style.visibility = 'hidden';
|
|
183
|
+
data.icon.onload = () => data.icon.style.visibility = 'inherit';
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
data.icon.style.visibility = 'inherit';
|
|
187
|
+
}
|
|
188
|
+
data.name.textContent = (element.marketplaceInfo?.displayName || element.description.identifier.value).substr(0, 50);
|
|
189
|
+
data.version.textContent = element.description.version;
|
|
190
|
+
const activationTimes = element.status.activationTimes;
|
|
191
|
+
if (activationTimes) {
|
|
192
|
+
const syncTime = activationTimes.codeLoadingTime + activationTimes.activateCallTime;
|
|
193
|
+
data.activationTime.textContent = activationTimes.activationReason.startup ? `Startup Activation: ${syncTime}ms` : `Activation: ${syncTime}ms`;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
data.activationTime.textContent = `Activating...`;
|
|
197
|
+
}
|
|
198
|
+
data.actionbar.clear();
|
|
199
|
+
const slowExtensionAction = this._createSlowExtensionAction(element);
|
|
200
|
+
if (slowExtensionAction) {
|
|
201
|
+
data.actionbar.push(slowExtensionAction, { icon: false, label: true });
|
|
202
|
+
}
|
|
203
|
+
if (isNonEmptyArray(element.status.runtimeErrors)) {
|
|
204
|
+
const reportExtensionIssueAction = this._createReportExtensionIssueAction(element);
|
|
205
|
+
if (reportExtensionIssueAction) {
|
|
206
|
+
data.actionbar.push(reportExtensionIssueAction, { icon: false, label: true });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
let title;
|
|
210
|
+
if (activationTimes) {
|
|
211
|
+
const activationId = activationTimes.activationReason.extensionId.value;
|
|
212
|
+
const activationEvent = activationTimes.activationReason.activationEvent;
|
|
213
|
+
if (activationEvent === '*') {
|
|
214
|
+
title = ( nls.localizeWithPath(
|
|
215
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
216
|
+
{
|
|
217
|
+
key: 'starActivation',
|
|
218
|
+
comment: [
|
|
219
|
+
'{0} will be an extension identifier'
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
"Activated by {0} on start-up",
|
|
223
|
+
activationId
|
|
224
|
+
));
|
|
225
|
+
}
|
|
226
|
+
else if (/^workspaceContains:/.test(activationEvent)) {
|
|
227
|
+
const fileNameOrGlob = activationEvent.substr('workspaceContains:'.length);
|
|
228
|
+
if (fileNameOrGlob.indexOf('*') >= 0 || fileNameOrGlob.indexOf('?') >= 0) {
|
|
229
|
+
title = ( nls.localizeWithPath(
|
|
230
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
231
|
+
{
|
|
232
|
+
key: 'workspaceContainsGlobActivation',
|
|
233
|
+
comment: [
|
|
234
|
+
'{0} will be a glob pattern',
|
|
235
|
+
'{1} will be an extension identifier'
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"Activated by {1} because a file matching {0} exists in your workspace",
|
|
239
|
+
fileNameOrGlob,
|
|
240
|
+
activationId
|
|
241
|
+
));
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
title = ( nls.localizeWithPath(
|
|
245
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
246
|
+
{
|
|
247
|
+
key: 'workspaceContainsFileActivation',
|
|
248
|
+
comment: [
|
|
249
|
+
'{0} will be a file name',
|
|
250
|
+
'{1} will be an extension identifier'
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
"Activated by {1} because file {0} exists in your workspace",
|
|
254
|
+
fileNameOrGlob,
|
|
255
|
+
activationId
|
|
256
|
+
));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else if (/^workspaceContainsTimeout:/.test(activationEvent)) {
|
|
260
|
+
const glob = activationEvent.substr('workspaceContainsTimeout:'.length);
|
|
261
|
+
title = ( nls.localizeWithPath(
|
|
262
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
263
|
+
{
|
|
264
|
+
key: 'workspaceContainsTimeout',
|
|
265
|
+
comment: [
|
|
266
|
+
'{0} will be a glob pattern',
|
|
267
|
+
'{1} will be an extension identifier'
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
"Activated by {1} because searching for {0} took too long",
|
|
271
|
+
glob,
|
|
272
|
+
activationId
|
|
273
|
+
));
|
|
274
|
+
}
|
|
275
|
+
else if (activationEvent === 'onStartupFinished') {
|
|
276
|
+
title = ( nls.localizeWithPath(
|
|
277
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
278
|
+
{
|
|
279
|
+
key: 'startupFinishedActivation',
|
|
280
|
+
comment: [
|
|
281
|
+
'This refers to an extension. {0} will be an activation event.'
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
"Activated by {0} after start-up finished",
|
|
285
|
+
activationId
|
|
286
|
+
));
|
|
287
|
+
}
|
|
288
|
+
else if (/^onLanguage:/.test(activationEvent)) {
|
|
289
|
+
const language = activationEvent.substr('onLanguage:'.length);
|
|
290
|
+
title = ( nls.localizeWithPath(
|
|
291
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
292
|
+
'languageActivation',
|
|
293
|
+
"Activated by {1} because you opened a {0} file",
|
|
294
|
+
language,
|
|
295
|
+
activationId
|
|
296
|
+
));
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
title = ( nls.localizeWithPath(
|
|
300
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
301
|
+
{
|
|
302
|
+
key: 'workspaceGenericActivation',
|
|
303
|
+
comment: [
|
|
304
|
+
'{0} will be an activation event, like e.g. \'language:typescript\', \'debug\', etc.',
|
|
305
|
+
'{1} will be an extension identifier'
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
"Activated by {1} on {0}",
|
|
309
|
+
activationEvent,
|
|
310
|
+
activationId
|
|
311
|
+
));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
title = ( nls.localizeWithPath(
|
|
316
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
317
|
+
'extensionActivating',
|
|
318
|
+
"Extension is activating..."
|
|
319
|
+
));
|
|
320
|
+
}
|
|
321
|
+
data.activationTime.title = title;
|
|
322
|
+
clearNode(data.msgContainer);
|
|
323
|
+
if (this._getUnresponsiveProfile(element.description.identifier)) {
|
|
324
|
+
const el = $('span', undefined, ...renderLabelWithIcons(` $(alert) Unresponsive`));
|
|
325
|
+
el.title = ( nls.localizeWithPath(
|
|
326
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
327
|
+
'unresponsive.title',
|
|
328
|
+
"Extension has caused the extension host to freeze."
|
|
329
|
+
));
|
|
330
|
+
data.msgContainer.appendChild(el);
|
|
331
|
+
}
|
|
332
|
+
if (isNonEmptyArray(element.status.runtimeErrors)) {
|
|
333
|
+
const el = $('span', undefined, ...renderLabelWithIcons(`$(bug) ${( nls.localizeWithPath(
|
|
334
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
335
|
+
'errors',
|
|
336
|
+
"{0} uncaught errors",
|
|
337
|
+
element.status.runtimeErrors.length
|
|
338
|
+
))}`));
|
|
339
|
+
data.msgContainer.appendChild(el);
|
|
340
|
+
}
|
|
341
|
+
if (element.status.messages && element.status.messages.length > 0) {
|
|
342
|
+
const el = $('span', undefined, ...renderLabelWithIcons(`$(alert) ${element.status.messages[0].message}`));
|
|
343
|
+
data.msgContainer.appendChild(el);
|
|
344
|
+
}
|
|
345
|
+
let extraLabel = null;
|
|
346
|
+
if (element.status.runningLocation && element.status.runningLocation.equals(( new LocalWebWorkerRunningLocation(0)))) {
|
|
347
|
+
extraLabel = `$(globe) web worker`;
|
|
348
|
+
}
|
|
349
|
+
else if (element.description.extensionLocation.scheme === Schemas.vscodeRemote) {
|
|
350
|
+
const hostLabel = this._labelService.getHostLabel(Schemas.vscodeRemote, this._environmentService.remoteAuthority);
|
|
351
|
+
if (hostLabel) {
|
|
352
|
+
extraLabel = `$(remote) ${hostLabel}`;
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
extraLabel = `$(remote) ${element.description.extensionLocation.authority}`;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
else if (element.status.runningLocation && element.status.runningLocation.affinity > 0) {
|
|
359
|
+
extraLabel = element.status.runningLocation instanceof LocalWebWorkerRunningLocation
|
|
360
|
+
? `$(globe) web worker ${element.status.runningLocation.affinity + 1}`
|
|
361
|
+
: `$(server-process) local process ${element.status.runningLocation.affinity + 1}`;
|
|
362
|
+
}
|
|
363
|
+
if (extraLabel) {
|
|
364
|
+
const el = $('span', undefined, ...renderLabelWithIcons(extraLabel));
|
|
365
|
+
data.msgContainer.appendChild(el);
|
|
366
|
+
}
|
|
367
|
+
if (element.profileInfo) {
|
|
368
|
+
data.profileTime.textContent = `Profile: ${(element.profileInfo.totalTime / 1000).toFixed(2)}ms`;
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
data.profileTime.textContent = '';
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
disposeTemplate: (data) => {
|
|
375
|
+
data.disposables = dispose(data.disposables);
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
this._list = this._instantiationService.createInstance(WorkbenchList, 'RuntimeExtensions', parent, delegate, [renderer], {
|
|
379
|
+
multipleSelectionSupport: false,
|
|
380
|
+
setRowLineHeight: false,
|
|
381
|
+
horizontalScrolling: false,
|
|
382
|
+
overrideStyles: {
|
|
383
|
+
listBackground: editorBackground
|
|
384
|
+
},
|
|
385
|
+
accessibilityProvider: new (class {
|
|
386
|
+
getWidgetAriaLabel() {
|
|
387
|
+
return ( nls.localizeWithPath(
|
|
388
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
389
|
+
'runtimeExtensions',
|
|
390
|
+
"Runtime Extensions"
|
|
391
|
+
));
|
|
392
|
+
}
|
|
393
|
+
getAriaLabel(element) {
|
|
394
|
+
return element.description.name;
|
|
395
|
+
}
|
|
396
|
+
})
|
|
397
|
+
});
|
|
398
|
+
this._list.splice(0, this._list.length, this._elements || undefined);
|
|
399
|
+
this._list.onContextMenu((e) => {
|
|
400
|
+
if (!e.element) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
const actions = [];
|
|
404
|
+
actions.push(( new Action('runtimeExtensionsEditor.action.copyId', ( nls.localizeWithPath(
|
|
405
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
406
|
+
'copy id',
|
|
407
|
+
"Copy id ({0})",
|
|
408
|
+
e.element.description.identifier.value
|
|
409
|
+
)), undefined, true, () => {
|
|
410
|
+
this._clipboardService.writeText(e.element.description.identifier.value);
|
|
411
|
+
})));
|
|
412
|
+
const reportExtensionIssueAction = this._createReportExtensionIssueAction(e.element);
|
|
413
|
+
if (reportExtensionIssueAction) {
|
|
414
|
+
actions.push(reportExtensionIssueAction);
|
|
415
|
+
}
|
|
416
|
+
actions.push(( new Separator()));
|
|
417
|
+
if (e.element.marketplaceInfo) {
|
|
418
|
+
actions.push(( new Action('runtimeExtensionsEditor.action.disableWorkspace', ( nls.localizeWithPath(
|
|
419
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
420
|
+
'disable workspace',
|
|
421
|
+
"Disable (Workspace)"
|
|
422
|
+
)), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element.marketplaceInfo, 7 ))));
|
|
423
|
+
actions.push(( new Action('runtimeExtensionsEditor.action.disable', ( nls.localizeWithPath(
|
|
424
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
425
|
+
'disable',
|
|
426
|
+
"Disable"
|
|
427
|
+
)), undefined, true, () => this._extensionsWorkbenchService.setEnablement(e.element.marketplaceInfo, 6 ))));
|
|
428
|
+
}
|
|
429
|
+
actions.push(( new Separator()));
|
|
430
|
+
const profileAction = this._createProfileAction();
|
|
431
|
+
if (profileAction) {
|
|
432
|
+
actions.push(profileAction);
|
|
433
|
+
}
|
|
434
|
+
const saveExtensionHostProfileAction = this.saveExtensionHostProfileAction;
|
|
435
|
+
if (saveExtensionHostProfileAction) {
|
|
436
|
+
actions.push(saveExtensionHostProfileAction);
|
|
437
|
+
}
|
|
438
|
+
this._contextMenuService.showContextMenu({
|
|
439
|
+
getAnchor: () => e.anchor,
|
|
440
|
+
getActions: () => actions
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
get saveExtensionHostProfileAction() {
|
|
445
|
+
return this._createSaveExtensionHostProfileAction();
|
|
446
|
+
}
|
|
447
|
+
layout(dimension) {
|
|
448
|
+
this._list?.layout(dimension.height);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
AbstractRuntimeExtensionsEditor.__decorator = ( __decorate([
|
|
452
|
+
memoize
|
|
453
|
+
], AbstractRuntimeExtensionsEditor.prototype, "saveExtensionHostProfileAction", null));
|
|
454
|
+
AbstractRuntimeExtensionsEditor = AbstractRuntimeExtensionsEditor_1 = ( __decorate([
|
|
455
|
+
( __param(0, ITelemetryService)),
|
|
456
|
+
( __param(1, IThemeService)),
|
|
457
|
+
( __param(2, IContextKeyService)),
|
|
458
|
+
( __param(3, IExtensionsWorkbenchService)),
|
|
459
|
+
( __param(4, IExtensionService)),
|
|
460
|
+
( __param(5, INotificationService)),
|
|
461
|
+
( __param(6, IContextMenuService)),
|
|
462
|
+
( __param(7, IInstantiationService)),
|
|
463
|
+
( __param(8, IStorageService)),
|
|
464
|
+
( __param(9, ILabelService)),
|
|
465
|
+
( __param(10, IWorkbenchEnvironmentService)),
|
|
466
|
+
( __param(11, IClipboardService))
|
|
467
|
+
], AbstractRuntimeExtensionsEditor));
|
|
468
|
+
class ShowRuntimeExtensionsAction extends Action2 {
|
|
469
|
+
constructor() {
|
|
470
|
+
super({
|
|
471
|
+
id: 'workbench.action.showRuntimeExtensions',
|
|
472
|
+
title: { value: ( nls.localizeWithPath(
|
|
473
|
+
'vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor',
|
|
474
|
+
'showRuntimeExtensions',
|
|
475
|
+
"Show Running Extensions"
|
|
476
|
+
)), original: 'Show Running Extensions' },
|
|
477
|
+
category: Categories.Developer,
|
|
478
|
+
f1: true,
|
|
479
|
+
menu: {
|
|
480
|
+
id: MenuId.ViewContainerTitle,
|
|
481
|
+
when: ( ContextKeyExpr.equals('viewContainer', 'workbench.view.extensions')),
|
|
482
|
+
group: '2_enablement',
|
|
483
|
+
order: 3
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
async run(accessor) {
|
|
488
|
+
await accessor.get(IEditorService).openEditor(RuntimeExtensionsInput.instance, { pinned: true });
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export { AbstractRuntimeExtensionsEditor, ShowRuntimeExtensionsAction };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AbstractRuntimeExtensionsEditor } from './abstractRuntimeExtensionsEditor.js';
|
|
2
|
+
import { ReportExtensionIssueAction } from '../common/reportExtensionIssueAction.js';
|
|
3
|
+
|
|
4
|
+
class RuntimeExtensionsEditor extends AbstractRuntimeExtensionsEditor {
|
|
5
|
+
_getProfileInfo() {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
_getUnresponsiveProfile(extensionId) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
_createSlowExtensionAction(element) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
_createReportExtensionIssueAction(element) {
|
|
15
|
+
if (element.marketplaceInfo) {
|
|
16
|
+
return this._instantiationService.createInstance(ReportExtensionIssueAction, element.description);
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
_createSaveExtensionHostProfileAction() {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
_createProfileAction() {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { RuntimeExtensionsEditor };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { IExtensionTipsService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
3
|
+
import { ExtensionRecommendations } from './extensionRecommendations.js';
|
|
4
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
5
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
6
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
7
|
+
|
|
8
|
+
let ConfigBasedRecommendations = class ConfigBasedRecommendations extends ExtensionRecommendations {
|
|
9
|
+
get otherRecommendations() { return this._otherRecommendations; }
|
|
10
|
+
get importantRecommendations() { return this._importantRecommendations; }
|
|
11
|
+
get recommendations() { return [...this.importantRecommendations, ...this.otherRecommendations]; }
|
|
12
|
+
constructor(extensionTipsService, workspaceContextService) {
|
|
13
|
+
super();
|
|
14
|
+
this.extensionTipsService = extensionTipsService;
|
|
15
|
+
this.workspaceContextService = workspaceContextService;
|
|
16
|
+
this.importantTips = [];
|
|
17
|
+
this.otherTips = [];
|
|
18
|
+
this._onDidChangeRecommendations = this._register(( new Emitter()));
|
|
19
|
+
this.onDidChangeRecommendations = this._onDidChangeRecommendations.event;
|
|
20
|
+
this._otherRecommendations = [];
|
|
21
|
+
this._importantRecommendations = [];
|
|
22
|
+
}
|
|
23
|
+
async doActivate() {
|
|
24
|
+
await this.fetch();
|
|
25
|
+
this._register(this.workspaceContextService.onDidChangeWorkspaceFolders(e => this.onWorkspaceFoldersChanged(e)));
|
|
26
|
+
}
|
|
27
|
+
async fetch() {
|
|
28
|
+
const workspace = this.workspaceContextService.getWorkspace();
|
|
29
|
+
const importantTips = ( new Map());
|
|
30
|
+
const otherTips = ( new Map());
|
|
31
|
+
for (const folder of workspace.folders) {
|
|
32
|
+
const configBasedTips = await this.extensionTipsService.getConfigBasedTips(folder.uri);
|
|
33
|
+
for (const tip of configBasedTips) {
|
|
34
|
+
if (tip.important) {
|
|
35
|
+
importantTips.set(tip.extensionId, tip);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
otherTips.set(tip.extensionId, tip);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
this.importantTips = [...( importantTips.values())];
|
|
43
|
+
this.otherTips = [...( otherTips.values())].filter(tip => !( importantTips.has(tip.extensionId)));
|
|
44
|
+
this._otherRecommendations = ( this.otherTips.map(tip => this.toExtensionRecommendation(tip)));
|
|
45
|
+
this._importantRecommendations = ( this.importantTips.map(tip => this.toExtensionRecommendation(tip)));
|
|
46
|
+
}
|
|
47
|
+
async onWorkspaceFoldersChanged(event) {
|
|
48
|
+
if (event.added.length) {
|
|
49
|
+
const oldImportantRecommended = this.importantTips;
|
|
50
|
+
await this.fetch();
|
|
51
|
+
if (( this.importantTips.some(
|
|
52
|
+
current => oldImportantRecommended.every(old => current.extensionId !== old.extensionId)
|
|
53
|
+
))) {
|
|
54
|
+
this._onDidChangeRecommendations.fire();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
toExtensionRecommendation(tip) {
|
|
59
|
+
return {
|
|
60
|
+
extensionId: tip.extensionId,
|
|
61
|
+
reason: {
|
|
62
|
+
reasonId: 3 ,
|
|
63
|
+
reasonText: ( localizeWithPath(
|
|
64
|
+
'vs/workbench/contrib/extensions/browser/configBasedRecommendations',
|
|
65
|
+
'exeBasedRecommendation',
|
|
66
|
+
"This extension is recommended because of the current workspace configuration"
|
|
67
|
+
))
|
|
68
|
+
},
|
|
69
|
+
whenNotInstalled: tip.whenNotInstalled
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
ConfigBasedRecommendations = ( __decorate([
|
|
74
|
+
( __param(0, IExtensionTipsService)),
|
|
75
|
+
( __param(1, IWorkspaceContextService))
|
|
76
|
+
], ConfigBasedRecommendations));
|
|
77
|
+
|
|
78
|
+
export { ConfigBasedRecommendations };
|