@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,221 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { IExtensionGalleryService, IExtensionManagementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
4
|
+
import { IExtensionIgnoredRecommendationsService } from 'vscode/vscode/vs/workbench/services/extensionRecommendations/common/extensionRecommendations';
|
|
5
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
6
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
7
|
+
import { distinct, shuffle } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
8
|
+
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
9
|
+
import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
|
|
10
|
+
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
11
|
+
import { ExeBasedRecommendations } from './exeBasedRecommendations.js';
|
|
12
|
+
import { WorkspaceRecommendations } from './workspaceRecommendations.js';
|
|
13
|
+
import { FileBasedRecommendations } from './fileBasedRecommendations.js';
|
|
14
|
+
import { KeymapRecommendations } from './keymapRecommendations.js';
|
|
15
|
+
import { LanguageRecommendations } from './languageRecommendations.js';
|
|
16
|
+
import { ConfigBasedRecommendations } from './configBasedRecommendations.js';
|
|
17
|
+
import { IExtensionRecommendationNotificationService } from 'vscode/vscode/vs/platform/extensionRecommendations/common/extensionRecommendations';
|
|
18
|
+
import { timeout } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
19
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
20
|
+
import { WebRecommendations } from './webRecommendations.js';
|
|
21
|
+
import { IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
22
|
+
import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
23
|
+
import { RemoteRecommendations } from './remoteRecommendations.js';
|
|
24
|
+
import { IRemoteExtensionsScannerService } from 'vscode/vscode/vs/platform/remote/common/remoteExtensionsScanner';
|
|
25
|
+
import { IUserDataInitializationService } from 'vscode/vscode/vs/workbench/services/userData/browser/userDataInit';
|
|
26
|
+
|
|
27
|
+
let ExtensionRecommendationsService = class ExtensionRecommendationsService extends Disposable {
|
|
28
|
+
constructor(instantiationService, lifecycleService, galleryService, telemetryService, environmentService, extensionManagementService, extensionRecommendationsManagementService, extensionRecommendationNotificationService, extensionsWorkbenchService, remoteExtensionsScannerService, userDataInitializationService) {
|
|
29
|
+
super();
|
|
30
|
+
this.lifecycleService = lifecycleService;
|
|
31
|
+
this.galleryService = galleryService;
|
|
32
|
+
this.telemetryService = telemetryService;
|
|
33
|
+
this.environmentService = environmentService;
|
|
34
|
+
this.extensionManagementService = extensionManagementService;
|
|
35
|
+
this.extensionRecommendationsManagementService = extensionRecommendationsManagementService;
|
|
36
|
+
this.extensionRecommendationNotificationService = extensionRecommendationNotificationService;
|
|
37
|
+
this.extensionsWorkbenchService = extensionsWorkbenchService;
|
|
38
|
+
this.remoteExtensionsScannerService = remoteExtensionsScannerService;
|
|
39
|
+
this.userDataInitializationService = userDataInitializationService;
|
|
40
|
+
this._onDidChangeRecommendations = this._register(( new Emitter()));
|
|
41
|
+
this.onDidChangeRecommendations = this._onDidChangeRecommendations.event;
|
|
42
|
+
this.workspaceRecommendations = this._register(instantiationService.createInstance(WorkspaceRecommendations));
|
|
43
|
+
this.fileBasedRecommendations = this._register(instantiationService.createInstance(FileBasedRecommendations));
|
|
44
|
+
this.configBasedRecommendations = this._register(instantiationService.createInstance(ConfigBasedRecommendations));
|
|
45
|
+
this.exeBasedRecommendations = this._register(instantiationService.createInstance(ExeBasedRecommendations));
|
|
46
|
+
this.keymapRecommendations = this._register(instantiationService.createInstance(KeymapRecommendations));
|
|
47
|
+
this.webRecommendations = this._register(instantiationService.createInstance(WebRecommendations));
|
|
48
|
+
this.languageRecommendations = this._register(instantiationService.createInstance(LanguageRecommendations));
|
|
49
|
+
this.remoteRecommendations = this._register(instantiationService.createInstance(RemoteRecommendations));
|
|
50
|
+
if (!this.isEnabled()) {
|
|
51
|
+
this.sessionSeed = 0;
|
|
52
|
+
this.activationPromise = Promise.resolve();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.sessionSeed = +( new Date());
|
|
56
|
+
this.activationPromise = this.activate();
|
|
57
|
+
this._register(this.extensionManagementService.onDidInstallExtensions(e => this.onDidInstallExtensions(e)));
|
|
58
|
+
}
|
|
59
|
+
async activate() {
|
|
60
|
+
try {
|
|
61
|
+
await Promise.allSettled([
|
|
62
|
+
this.remoteExtensionsScannerService.whenExtensionsReady(),
|
|
63
|
+
this.userDataInitializationService.whenInitializationFinished(),
|
|
64
|
+
this.lifecycleService.when(3 )
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
catch (error) { }
|
|
68
|
+
await Promise.all([
|
|
69
|
+
this.workspaceRecommendations.activate(),
|
|
70
|
+
this.configBasedRecommendations.activate(),
|
|
71
|
+
this.fileBasedRecommendations.activate(),
|
|
72
|
+
this.keymapRecommendations.activate(),
|
|
73
|
+
this.languageRecommendations.activate(),
|
|
74
|
+
this.webRecommendations.activate(),
|
|
75
|
+
this.remoteRecommendations.activate()
|
|
76
|
+
]);
|
|
77
|
+
this._register(Event.any(this.workspaceRecommendations.onDidChangeRecommendations, this.configBasedRecommendations.onDidChangeRecommendations, this.extensionRecommendationsManagementService.onDidChangeIgnoredRecommendations)(() => this._onDidChangeRecommendations.fire()));
|
|
78
|
+
this._register(this.extensionRecommendationsManagementService.onDidChangeGlobalIgnoredRecommendation(({ extensionId, isRecommended }) => {
|
|
79
|
+
if (!isRecommended) {
|
|
80
|
+
const reason = this.getAllRecommendationsWithReason()[extensionId];
|
|
81
|
+
if (reason && reason.reasonId) {
|
|
82
|
+
this.telemetryService.publicLog2('extensionsRecommendations:ignoreRecommendation', { extensionId, recommendationReason: reason.reasonId });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
this.promptWorkspaceRecommendations();
|
|
87
|
+
}
|
|
88
|
+
isEnabled() {
|
|
89
|
+
return this.galleryService.isEnabled() && !this.environmentService.isExtensionDevelopment;
|
|
90
|
+
}
|
|
91
|
+
async activateProactiveRecommendations() {
|
|
92
|
+
await Promise.all([this.exeBasedRecommendations.activate(), this.configBasedRecommendations.activate()]);
|
|
93
|
+
}
|
|
94
|
+
getAllRecommendationsWithReason() {
|
|
95
|
+
this.activateProactiveRecommendations();
|
|
96
|
+
const output = Object.create(null);
|
|
97
|
+
const allRecommendations = [
|
|
98
|
+
...this.configBasedRecommendations.recommendations,
|
|
99
|
+
...this.exeBasedRecommendations.recommendations,
|
|
100
|
+
...this.fileBasedRecommendations.recommendations,
|
|
101
|
+
...this.workspaceRecommendations.recommendations,
|
|
102
|
+
...this.keymapRecommendations.recommendations,
|
|
103
|
+
...this.languageRecommendations.recommendations,
|
|
104
|
+
...this.webRecommendations.recommendations,
|
|
105
|
+
];
|
|
106
|
+
for (const { extensionId, reason } of allRecommendations) {
|
|
107
|
+
if (this.isExtensionAllowedToBeRecommended(extensionId)) {
|
|
108
|
+
output[extensionId.toLowerCase()] = reason;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return output;
|
|
112
|
+
}
|
|
113
|
+
async getConfigBasedRecommendations() {
|
|
114
|
+
await this.configBasedRecommendations.activate();
|
|
115
|
+
return {
|
|
116
|
+
important: this.toExtensionRecommendations(this.configBasedRecommendations.importantRecommendations),
|
|
117
|
+
others: this.toExtensionRecommendations(this.configBasedRecommendations.otherRecommendations)
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
async getOtherRecommendations() {
|
|
121
|
+
await this.activationPromise;
|
|
122
|
+
await this.activateProactiveRecommendations();
|
|
123
|
+
const recommendations = [
|
|
124
|
+
...this.configBasedRecommendations.otherRecommendations,
|
|
125
|
+
...this.exeBasedRecommendations.otherRecommendations,
|
|
126
|
+
...this.webRecommendations.recommendations
|
|
127
|
+
];
|
|
128
|
+
const extensionIds = distinct(( recommendations.map(e => e.extensionId)))
|
|
129
|
+
.filter(extensionId => this.isExtensionAllowedToBeRecommended(extensionId));
|
|
130
|
+
shuffle(extensionIds, this.sessionSeed);
|
|
131
|
+
return extensionIds;
|
|
132
|
+
}
|
|
133
|
+
async getImportantRecommendations() {
|
|
134
|
+
await this.activateProactiveRecommendations();
|
|
135
|
+
const recommendations = [
|
|
136
|
+
...this.fileBasedRecommendations.importantRecommendations,
|
|
137
|
+
...this.configBasedRecommendations.importantRecommendations,
|
|
138
|
+
...this.exeBasedRecommendations.importantRecommendations,
|
|
139
|
+
];
|
|
140
|
+
const extensionIds = distinct(( recommendations.map(e => e.extensionId)))
|
|
141
|
+
.filter(extensionId => this.isExtensionAllowedToBeRecommended(extensionId));
|
|
142
|
+
shuffle(extensionIds, this.sessionSeed);
|
|
143
|
+
return extensionIds;
|
|
144
|
+
}
|
|
145
|
+
getKeymapRecommendations() {
|
|
146
|
+
return this.toExtensionRecommendations(this.keymapRecommendations.recommendations);
|
|
147
|
+
}
|
|
148
|
+
getLanguageRecommendations() {
|
|
149
|
+
return this.toExtensionRecommendations(this.languageRecommendations.recommendations);
|
|
150
|
+
}
|
|
151
|
+
getRemoteRecommendations() {
|
|
152
|
+
return this.toExtensionRecommendations(this.remoteRecommendations.recommendations);
|
|
153
|
+
}
|
|
154
|
+
async getWorkspaceRecommendations() {
|
|
155
|
+
if (!this.isEnabled()) {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
await this.workspaceRecommendations.activate();
|
|
159
|
+
return this.toExtensionRecommendations(this.workspaceRecommendations.recommendations);
|
|
160
|
+
}
|
|
161
|
+
async getExeBasedRecommendations(exe) {
|
|
162
|
+
await this.exeBasedRecommendations.activate();
|
|
163
|
+
const { important, others } = exe ? this.exeBasedRecommendations.getRecommendations(exe)
|
|
164
|
+
: { important: this.exeBasedRecommendations.importantRecommendations, others: this.exeBasedRecommendations.otherRecommendations };
|
|
165
|
+
return { important: this.toExtensionRecommendations(important), others: this.toExtensionRecommendations(others) };
|
|
166
|
+
}
|
|
167
|
+
getFileBasedRecommendations() {
|
|
168
|
+
return this.toExtensionRecommendations(this.fileBasedRecommendations.recommendations);
|
|
169
|
+
}
|
|
170
|
+
onDidInstallExtensions(results) {
|
|
171
|
+
for (const e of results) {
|
|
172
|
+
if (e.source && !URI.isUri(e.source) && e.operation === 2 ) {
|
|
173
|
+
const extRecommendations = this.getAllRecommendationsWithReason() || {};
|
|
174
|
+
const recommendationReason = extRecommendations[e.source.identifier.id.toLowerCase()];
|
|
175
|
+
if (recommendationReason) {
|
|
176
|
+
this.telemetryService.publicLog('extensionGallery:install:recommendations', { ...e.source.telemetryData, recommendationReason: recommendationReason.reasonId });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
toExtensionRecommendations(recommendations) {
|
|
182
|
+
const extensionIds = distinct(( recommendations.map(e => e.extensionId)))
|
|
183
|
+
.filter(extensionId => this.isExtensionAllowedToBeRecommended(extensionId));
|
|
184
|
+
return extensionIds;
|
|
185
|
+
}
|
|
186
|
+
isExtensionAllowedToBeRecommended(extensionId) {
|
|
187
|
+
return !this.extensionRecommendationsManagementService.ignoredRecommendations.includes(extensionId.toLowerCase());
|
|
188
|
+
}
|
|
189
|
+
async promptWorkspaceRecommendations() {
|
|
190
|
+
const installed = await this.extensionsWorkbenchService.queryLocal();
|
|
191
|
+
const allowedRecommendations = ( [
|
|
192
|
+
...this.workspaceRecommendations.recommendations,
|
|
193
|
+
...this.configBasedRecommendations.importantRecommendations.filter(recommendation => !recommendation.whenNotInstalled || recommendation.whenNotInstalled.every(id => installed.every(local => !areSameExtensions(local.identifier, { id }))))
|
|
194
|
+
]
|
|
195
|
+
.map(({ extensionId }) => extensionId))
|
|
196
|
+
.filter(extensionId => this.isExtensionAllowedToBeRecommended(extensionId));
|
|
197
|
+
if (allowedRecommendations.length) {
|
|
198
|
+
await this._registerP(timeout(5000));
|
|
199
|
+
await this.extensionRecommendationNotificationService.promptWorkspaceRecommendations(allowedRecommendations);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
_registerP(o) {
|
|
203
|
+
this._register(toDisposable(() => o.cancel()));
|
|
204
|
+
return o;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
ExtensionRecommendationsService = ( __decorate([
|
|
208
|
+
( __param(0, IInstantiationService)),
|
|
209
|
+
( __param(1, ILifecycleService)),
|
|
210
|
+
( __param(2, IExtensionGalleryService)),
|
|
211
|
+
( __param(3, ITelemetryService)),
|
|
212
|
+
( __param(4, IEnvironmentService)),
|
|
213
|
+
( __param(5, IExtensionManagementService)),
|
|
214
|
+
( __param(6, IExtensionIgnoredRecommendationsService)),
|
|
215
|
+
( __param(7, IExtensionRecommendationNotificationService)),
|
|
216
|
+
( __param(8, IExtensionsWorkbenchService)),
|
|
217
|
+
( __param(9, IRemoteExtensionsScannerService)),
|
|
218
|
+
( __param(10, IUserDataInitializationService))
|
|
219
|
+
], ExtensionRecommendationsService));
|
|
220
|
+
|
|
221
|
+
export { ExtensionRecommendationsService };
|