@codingame/monaco-vscode-extensions-service-override 4.5.0 → 4.5.2
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/index.d.ts +2 -2
- package/package.json +3 -3
- package/vscode/src/vs/base/common/console.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +67 -134
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +32 -37
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +12 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +5 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +44 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +60 -66
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +10 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +41 -50
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +53 -100
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +21 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +47 -56
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +7 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +11 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +8 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +179 -162
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +28 -30
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +23 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +19 -18
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +36 -33
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +2 -2
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +56 -121
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +5 -5
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +130 -142
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +33 -32
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +9 -8
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +1 -1
- package/extensions.d.ts +0 -44
- package/localExtensionHost.d.ts +0 -41
- package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.service.d.ts +0 -13
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.d.ts +0 -53
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +0 -106
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +0 -45
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.d.ts +0 -10
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +0 -162
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +0 -18
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManagers.d.ts +0 -39
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProxy.d.ts +0 -17
- package/vscode/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.service.d.ts +0 -20
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.d.ts +0 -45
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.d.ts +0 -17
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.d.ts +0 -6
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +0 -49
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.service.d.ts +0 -40
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.d.ts +0 -185
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.d.ts +0 -11
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.service.d.ts +0 -9
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
1
|
+
export * from 'vscode/service-override/extensions';
|
|
2
|
+
export { default } from 'vscode/service-override/extensions';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extensions-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
30
|
-
"@codingame/monaco-vscode-files-service-override": "4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2",
|
|
30
|
+
"@codingame/monaco-vscode-files-service-override": "4.5.2"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -51,7 +51,7 @@ function log(entry, label) {
|
|
|
51
51
|
consoleArgs.push(topFrame);
|
|
52
52
|
}
|
|
53
53
|
if (typeof console[entry.severity] !== 'function') {
|
|
54
|
-
throw new Error('Unknown console method');
|
|
54
|
+
throw ( new Error('Unknown console method'));
|
|
55
55
|
}
|
|
56
56
|
console[entry.severity].apply(console, consoleArgs);
|
|
57
57
|
}
|
|
@@ -11,15 +11,11 @@ import { IExtensionManagementService, IExtensionGalleryService } from 'vscode/vs
|
|
|
11
11
|
import { getIdAndVersion, areSameExtensions, getGalleryExtensionId, getExtensionId } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
12
12
|
import { EXTENSION_CATEGORIES } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
'notFound',
|
|
17
|
-
"Extension '{0}' not found.",
|
|
18
|
-
id
|
|
19
|
-
));
|
|
14
|
+
const _moduleId = "vs/platform/extensionManagement/common/extensionManagementCLI";
|
|
15
|
+
const notFound = (id) => ( localizeWithPath(_moduleId, 0, "Extension '{0}' not found.", id));
|
|
20
16
|
const useId = ( localizeWithPath(
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
_moduleId,
|
|
18
|
+
1,
|
|
23
19
|
"Make sure you use the full extension ID, including the publisher, e.g.: {0}",
|
|
24
20
|
'ms-dotnettools.csharp'
|
|
25
21
|
));
|
|
@@ -34,7 +30,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
34
30
|
}
|
|
35
31
|
async listExtensions(showVersions, category, profileLocation) {
|
|
36
32
|
let extensions = await this.extensionManagementService.getInstalled(1 , profileLocation);
|
|
37
|
-
const categories = ( EXTENSION_CATEGORIES.map(c => c.toLowerCase()));
|
|
33
|
+
const categories = ( (EXTENSION_CATEGORIES.map(c => c.toLowerCase())));
|
|
38
34
|
if (category && category !== '') {
|
|
39
35
|
if (categories.indexOf(category.toLowerCase()) < 0) {
|
|
40
36
|
this.logger.info('Invalid category please enter a valid category. To list valid categories run --category without a category specified');
|
|
@@ -42,7 +38,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
42
38
|
}
|
|
43
39
|
extensions = extensions.filter(e => {
|
|
44
40
|
if (e.manifest.categories) {
|
|
45
|
-
const lowerCaseCategories = ( e.manifest.categories.map(c => c.toLowerCase()));
|
|
41
|
+
const lowerCaseCategories = ( (e.manifest.categories.map(c => c.toLowerCase())));
|
|
46
42
|
return lowerCaseCategories.indexOf(category.toLowerCase()) > -1;
|
|
47
43
|
}
|
|
48
44
|
return false;
|
|
@@ -56,12 +52,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
56
52
|
return;
|
|
57
53
|
}
|
|
58
54
|
if (this.location) {
|
|
59
|
-
this.logger.info(( localizeWithPath(
|
|
60
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
61
|
-
'listFromLocation',
|
|
62
|
-
"Extensions installed on {0}:",
|
|
63
|
-
this.location
|
|
64
|
-
)));
|
|
55
|
+
this.logger.info(( localizeWithPath(_moduleId, 2, "Extensions installed on {0}:", this.location)));
|
|
65
56
|
}
|
|
66
57
|
extensions = extensions.sort((e1, e2) => e1.identifier.id.localeCompare(e2.identifier.id));
|
|
67
58
|
let lastId = undefined;
|
|
@@ -76,16 +67,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
76
67
|
const failed = [];
|
|
77
68
|
try {
|
|
78
69
|
if (extensions.length) {
|
|
79
|
-
this.logger.info(this.location ? ( localizeWithPath(
|
|
80
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
81
|
-
'installingExtensionsOnLocation',
|
|
82
|
-
"Installing extensions on {0}...",
|
|
83
|
-
this.location
|
|
84
|
-
)) : ( localizeWithPath(
|
|
85
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
86
|
-
'installingExtensions',
|
|
87
|
-
"Installing extensions..."
|
|
88
|
-
)));
|
|
70
|
+
this.logger.info(this.location ? ( localizeWithPath(_moduleId, 3, "Installing extensions on {0}...", this.location)) : ( localizeWithPath(_moduleId, 4, "Installing extensions...")));
|
|
89
71
|
}
|
|
90
72
|
const installVSIXInfos = [];
|
|
91
73
|
const installExtensionInfos = [];
|
|
@@ -112,15 +94,15 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
112
94
|
}
|
|
113
95
|
const installed = await this.extensionManagementService.getInstalled(1 , installOptions.profileLocation);
|
|
114
96
|
if (installVSIXInfos.length) {
|
|
115
|
-
await Promise.all(( installVSIXInfos.map(async ({ vsix, installOptions }) => {
|
|
97
|
+
await Promise.all(( (installVSIXInfos.map(async ({ vsix, installOptions }) => {
|
|
116
98
|
try {
|
|
117
99
|
await this.installVSIX(vsix, installOptions, force, installed);
|
|
118
100
|
}
|
|
119
101
|
catch (err) {
|
|
120
102
|
this.logger.error(err);
|
|
121
|
-
failed.push(( vsix.toString()));
|
|
103
|
+
failed.push(( (vsix.toString())));
|
|
122
104
|
}
|
|
123
|
-
})));
|
|
105
|
+
}))));
|
|
124
106
|
}
|
|
125
107
|
if (installExtensionInfos.length) {
|
|
126
108
|
const failedGalleryExtensions = await this.installGalleryExtensions(installExtensionInfos, installed, force);
|
|
@@ -129,15 +111,17 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
129
111
|
}
|
|
130
112
|
catch (error) {
|
|
131
113
|
this.logger.error(( localizeWithPath(
|
|
132
|
-
|
|
133
|
-
|
|
114
|
+
_moduleId,
|
|
115
|
+
5,
|
|
134
116
|
"Error while installing extensions: {0}",
|
|
135
117
|
getErrorMessage(error)
|
|
136
118
|
)));
|
|
137
119
|
throw error;
|
|
138
120
|
}
|
|
139
121
|
if (failed.length) {
|
|
140
|
-
throw new Error(
|
|
122
|
+
throw ( (new Error(
|
|
123
|
+
localizeWithPath(_moduleId, 6, "Failed Installing Extensions: {0}", failed.join(', '))
|
|
124
|
+
)));
|
|
141
125
|
}
|
|
142
126
|
}
|
|
143
127
|
async updateExtensions(profileLocation) {
|
|
@@ -149,8 +133,8 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
149
133
|
}
|
|
150
134
|
}
|
|
151
135
|
this.logger.trace(( localizeWithPath(
|
|
152
|
-
|
|
153
|
-
|
|
136
|
+
_moduleId,
|
|
137
|
+
7,
|
|
154
138
|
"Fetching latest versions for {0} extensions",
|
|
155
139
|
installedExtensionsQuery.length
|
|
156
140
|
)));
|
|
@@ -167,25 +151,21 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
167
151
|
}
|
|
168
152
|
}
|
|
169
153
|
if (!extensionsToUpdate.length) {
|
|
170
|
-
this.logger.info(( localizeWithPath(
|
|
171
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
172
|
-
'updateExtensionsNoExtensions',
|
|
173
|
-
"No extension to update"
|
|
174
|
-
)));
|
|
154
|
+
this.logger.info(( localizeWithPath(_moduleId, 8, "No extension to update")));
|
|
175
155
|
return;
|
|
176
156
|
}
|
|
177
157
|
this.logger.info(( localizeWithPath(
|
|
178
|
-
|
|
179
|
-
|
|
158
|
+
_moduleId,
|
|
159
|
+
9,
|
|
180
160
|
"Updating extensions: {0}",
|
|
181
|
-
( extensionsToUpdate.map(ext => ext.extension.identifier.id)).join(', ')
|
|
161
|
+
( (extensionsToUpdate.map(ext => ext.extension.identifier.id))).join(', ')
|
|
182
162
|
)));
|
|
183
163
|
const installationResult = await this.extensionManagementService.installGalleryExtensions(extensionsToUpdate);
|
|
184
164
|
for (const extensionResult of installationResult) {
|
|
185
165
|
if (extensionResult.error) {
|
|
186
166
|
this.logger.error(( localizeWithPath(
|
|
187
|
-
|
|
188
|
-
|
|
167
|
+
_moduleId,
|
|
168
|
+
10,
|
|
189
169
|
"Error while updating extension {0}: {1}",
|
|
190
170
|
extensionResult.identifier.id,
|
|
191
171
|
getErrorMessage(extensionResult.error)
|
|
@@ -193,8 +173,8 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
193
173
|
}
|
|
194
174
|
else {
|
|
195
175
|
this.logger.info(( localizeWithPath(
|
|
196
|
-
|
|
197
|
-
|
|
176
|
+
_moduleId,
|
|
177
|
+
11,
|
|
198
178
|
"Extension '{0}' v{1} was successfully updated.",
|
|
199
179
|
extensionResult.identifier.id,
|
|
200
180
|
extensionResult.local?.manifest.version
|
|
@@ -208,8 +188,8 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
208
188
|
if (installedExtension) {
|
|
209
189
|
if (!force && (!version || (version === 'prerelease' && installedExtension.preRelease))) {
|
|
210
190
|
this.logger.info(( localizeWithPath(
|
|
211
|
-
|
|
212
|
-
|
|
191
|
+
_moduleId,
|
|
192
|
+
12,
|
|
213
193
|
"Extension '{0}' v{1} is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: '{2}@1.2.3'.",
|
|
214
194
|
id,
|
|
215
195
|
installedExtension.manifest.version,
|
|
@@ -218,12 +198,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
218
198
|
return false;
|
|
219
199
|
}
|
|
220
200
|
if (version && installedExtension.manifest.version === version) {
|
|
221
|
-
this.logger.info(( localizeWithPath(
|
|
222
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
223
|
-
'alreadyInstalled',
|
|
224
|
-
"Extension '{0}' is already installed.",
|
|
225
|
-
`${id}@${version}`
|
|
226
|
-
)));
|
|
201
|
+
this.logger.info(( localizeWithPath(_moduleId, 13, "Extension '{0}' is already installed.", `${id}@${version}`)));
|
|
227
202
|
return false;
|
|
228
203
|
}
|
|
229
204
|
}
|
|
@@ -235,7 +210,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
235
210
|
const failed = [];
|
|
236
211
|
const extensionsToInstall = [];
|
|
237
212
|
const galleryExtensions = await this.getGalleryExtensions(installExtensionInfos);
|
|
238
|
-
await Promise.all(( installExtensionInfos.map(async ({ id, version, installOptions }) => {
|
|
213
|
+
await Promise.all(( (installExtensionInfos.map(async ({ id, version, installOptions }) => {
|
|
239
214
|
const gallery = galleryExtensions.get(id.toLowerCase());
|
|
240
215
|
if (!gallery) {
|
|
241
216
|
this.logger.error(`${notFound(version ? `${id}@${version}` : id)}\n${useId}`);
|
|
@@ -257,61 +232,39 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
257
232
|
if (installedExtension) {
|
|
258
233
|
if (gallery.version === installedExtension.manifest.version) {
|
|
259
234
|
this.logger.info(( localizeWithPath(
|
|
260
|
-
|
|
261
|
-
|
|
235
|
+
_moduleId,
|
|
236
|
+
13,
|
|
262
237
|
"Extension '{0}' is already installed.",
|
|
263
238
|
version ? `${id}@${version}` : id
|
|
264
239
|
)));
|
|
265
240
|
return;
|
|
266
241
|
}
|
|
267
242
|
this.logger.info(( localizeWithPath(
|
|
268
|
-
|
|
269
|
-
|
|
243
|
+
_moduleId,
|
|
244
|
+
14,
|
|
270
245
|
"Updating the extension '{0}' to the version {1}",
|
|
271
246
|
id,
|
|
272
247
|
gallery.version
|
|
273
248
|
)));
|
|
274
249
|
}
|
|
275
250
|
if (installOptions.isBuiltin) {
|
|
276
|
-
this.logger.info(version ? ( localizeWithPath(
|
|
277
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
278
|
-
'installing builtin with version',
|
|
279
|
-
"Installing builtin extension '{0}' v{1}...",
|
|
280
|
-
id,
|
|
281
|
-
version
|
|
282
|
-
)) : ( localizeWithPath(
|
|
283
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
284
|
-
'installing builtin ',
|
|
285
|
-
"Installing builtin extension '{0}'...",
|
|
286
|
-
id
|
|
287
|
-
)));
|
|
251
|
+
this.logger.info(version ? ( localizeWithPath(_moduleId, 15, "Installing builtin extension '{0}' v{1}...", id, version)) : ( localizeWithPath(_moduleId, 16, "Installing builtin extension '{0}'...", id)));
|
|
288
252
|
}
|
|
289
253
|
else {
|
|
290
|
-
this.logger.info(version ? ( localizeWithPath(
|
|
291
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
292
|
-
'installing with version',
|
|
293
|
-
"Installing extension '{0}' v{1}...",
|
|
294
|
-
id,
|
|
295
|
-
version
|
|
296
|
-
)) : ( localizeWithPath(
|
|
297
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
298
|
-
'installing',
|
|
299
|
-
"Installing extension '{0}'...",
|
|
300
|
-
id
|
|
301
|
-
)));
|
|
254
|
+
this.logger.info(version ? ( localizeWithPath(_moduleId, 17, "Installing extension '{0}' v{1}...", id, version)) : ( localizeWithPath(_moduleId, 18, "Installing extension '{0}'...", id)));
|
|
302
255
|
}
|
|
303
256
|
extensionsToInstall.push({
|
|
304
257
|
extension: gallery,
|
|
305
258
|
options: { ...installOptions, installGivenVersion: !!version },
|
|
306
259
|
});
|
|
307
|
-
})));
|
|
260
|
+
}))));
|
|
308
261
|
if (extensionsToInstall.length) {
|
|
309
262
|
const installationResult = await this.extensionManagementService.installGalleryExtensions(extensionsToInstall);
|
|
310
263
|
for (const extensionResult of installationResult) {
|
|
311
264
|
if (extensionResult.error) {
|
|
312
265
|
this.logger.error(( localizeWithPath(
|
|
313
|
-
|
|
314
|
-
|
|
266
|
+
_moduleId,
|
|
267
|
+
19,
|
|
315
268
|
"Error while installing extension {0}: {1}",
|
|
316
269
|
extensionResult.identifier.id,
|
|
317
270
|
getErrorMessage(extensionResult.error)
|
|
@@ -320,8 +273,8 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
320
273
|
}
|
|
321
274
|
else {
|
|
322
275
|
this.logger.info(( localizeWithPath(
|
|
323
|
-
|
|
324
|
-
|
|
276
|
+
_moduleId,
|
|
277
|
+
20,
|
|
325
278
|
"Extension '{0}' v{1} was successfully installed.",
|
|
326
279
|
extensionResult.identifier.id,
|
|
327
280
|
extensionResult.local?.manifest.version
|
|
@@ -334,27 +287,22 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
334
287
|
async installVSIX(vsix, installOptions, force, installedExtensions) {
|
|
335
288
|
const manifest = await this.extensionManagementService.getManifest(vsix);
|
|
336
289
|
if (!manifest) {
|
|
337
|
-
throw new Error('Invalid vsix');
|
|
290
|
+
throw ( (new Error('Invalid vsix')));
|
|
338
291
|
}
|
|
339
292
|
const valid = await this.validateVSIX(manifest, force, installOptions.profileLocation, installedExtensions);
|
|
340
293
|
if (valid) {
|
|
341
294
|
try {
|
|
342
295
|
await this.extensionManagementService.install(vsix, installOptions);
|
|
343
296
|
this.logger.info(( localizeWithPath(
|
|
344
|
-
|
|
345
|
-
|
|
297
|
+
_moduleId,
|
|
298
|
+
21,
|
|
346
299
|
"Extension '{0}' was successfully installed.",
|
|
347
300
|
basename(vsix)
|
|
348
301
|
)));
|
|
349
302
|
}
|
|
350
303
|
catch (error) {
|
|
351
304
|
if (isCancellationError(error)) {
|
|
352
|
-
this.logger.info(( localizeWithPath(
|
|
353
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
354
|
-
'cancelVsixInstall',
|
|
355
|
-
"Cancelled installing extension '{0}'.",
|
|
356
|
-
basename(vsix)
|
|
357
|
-
)));
|
|
305
|
+
this.logger.info(( localizeWithPath(_moduleId, 22, "Cancelled installing extension '{0}'.", basename(vsix))));
|
|
358
306
|
}
|
|
359
307
|
else {
|
|
360
308
|
throw error;
|
|
@@ -363,8 +311,8 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
363
311
|
}
|
|
364
312
|
}
|
|
365
313
|
async getGalleryExtensions(extensions) {
|
|
366
|
-
const galleryExtensions = ( new Map());
|
|
367
|
-
const preRelease = ( extensions.some(e => e.installOptions.installPreReleaseVersion));
|
|
314
|
+
const galleryExtensions = ( (new Map()));
|
|
315
|
+
const preRelease = ( (extensions.some(e => e.installOptions.installPreReleaseVersion)));
|
|
368
316
|
const targetPlatform = await this.extensionManagementService.getTargetPlatform();
|
|
369
317
|
const extensionInfos = [];
|
|
370
318
|
for (const extension of extensions) {
|
|
@@ -389,8 +337,8 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
389
337
|
const newer = installedExtensions.find(local => areSameExtensions(extensionIdentifier, local.identifier) && semverExports.gt(local.manifest.version, manifest.version));
|
|
390
338
|
if (newer) {
|
|
391
339
|
this.logger.info(( localizeWithPath(
|
|
392
|
-
|
|
393
|
-
|
|
340
|
+
_moduleId,
|
|
341
|
+
23,
|
|
394
342
|
"A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",
|
|
395
343
|
newer.identifier.id,
|
|
396
344
|
newer.manifest.version,
|
|
@@ -414,51 +362,41 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
414
362
|
const installed = await this.extensionManagementService.getInstalled(undefined, profileLocation);
|
|
415
363
|
const extensionsToUninstall = installed.filter(e => areSameExtensions(e.identifier, { id }));
|
|
416
364
|
if (!extensionsToUninstall.length) {
|
|
417
|
-
throw new Error(`${this.notInstalled(id)}\n${useId}`);
|
|
365
|
+
throw ( (new Error(`${this.notInstalled(id)}\n${useId}`)));
|
|
418
366
|
}
|
|
419
|
-
if (( extensionsToUninstall.some(e => e.type === 0 ))) {
|
|
367
|
+
if (( (extensionsToUninstall.some(e => e.type === 0 )))) {
|
|
420
368
|
this.logger.info(( localizeWithPath(
|
|
421
|
-
|
|
422
|
-
|
|
369
|
+
_moduleId,
|
|
370
|
+
24,
|
|
423
371
|
"Extension '{0}' is a Built-in extension and cannot be uninstalled",
|
|
424
372
|
id
|
|
425
373
|
)));
|
|
426
374
|
return;
|
|
427
375
|
}
|
|
428
|
-
if (!force && ( extensionsToUninstall.some(e => e.isBuiltin))) {
|
|
376
|
+
if (!force && ( (extensionsToUninstall.some(e => e.isBuiltin)))) {
|
|
429
377
|
this.logger.info(( localizeWithPath(
|
|
430
|
-
|
|
431
|
-
|
|
378
|
+
_moduleId,
|
|
379
|
+
25,
|
|
432
380
|
"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",
|
|
433
381
|
id
|
|
434
382
|
)));
|
|
435
383
|
return;
|
|
436
384
|
}
|
|
437
|
-
this.logger.info(( localizeWithPath(
|
|
438
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
439
|
-
'uninstalling',
|
|
440
|
-
"Uninstalling {0}...",
|
|
441
|
-
id
|
|
442
|
-
)));
|
|
385
|
+
this.logger.info(( localizeWithPath(_moduleId, 26, "Uninstalling {0}...", id)));
|
|
443
386
|
for (const extensionToUninstall of extensionsToUninstall) {
|
|
444
387
|
await this.extensionManagementService.uninstall(extensionToUninstall, { profileLocation });
|
|
445
388
|
}
|
|
446
389
|
if (this.location) {
|
|
447
390
|
this.logger.info(( localizeWithPath(
|
|
448
|
-
|
|
449
|
-
|
|
391
|
+
_moduleId,
|
|
392
|
+
27,
|
|
450
393
|
"Extension '{0}' was successfully uninstalled from {1}!",
|
|
451
394
|
id,
|
|
452
395
|
this.location
|
|
453
396
|
)));
|
|
454
397
|
}
|
|
455
398
|
else {
|
|
456
|
-
this.logger.info(( localizeWithPath(
|
|
457
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
458
|
-
'successUninstall',
|
|
459
|
-
"Extension '{0}' was successfully uninstalled!",
|
|
460
|
-
id
|
|
461
|
-
)));
|
|
399
|
+
this.logger.info(( localizeWithPath(_moduleId, 28, "Extension '{0}' was successfully uninstalled!", id)));
|
|
462
400
|
}
|
|
463
401
|
}
|
|
464
402
|
}
|
|
@@ -477,22 +415,17 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
477
415
|
}
|
|
478
416
|
notInstalled(id) {
|
|
479
417
|
return this.location ? ( localizeWithPath(
|
|
480
|
-
|
|
481
|
-
|
|
418
|
+
_moduleId,
|
|
419
|
+
29,
|
|
482
420
|
"Extension '{0}' is not installed on {1}.",
|
|
483
421
|
id,
|
|
484
422
|
this.location
|
|
485
|
-
)) : ( localizeWithPath(
|
|
486
|
-
'vs/platform/extensionManagement/common/extensionManagementCLI',
|
|
487
|
-
'notInstalled',
|
|
488
|
-
"Extension '{0}' is not installed.",
|
|
489
|
-
id
|
|
490
|
-
));
|
|
423
|
+
)) : ( localizeWithPath(_moduleId, 30, "Extension '{0}' is not installed.", id));
|
|
491
424
|
}
|
|
492
425
|
};
|
|
493
|
-
ExtensionManagementCLI = ( __decorate([
|
|
494
|
-
( __param(1, IExtensionManagementService)),
|
|
495
|
-
( __param(2, IExtensionGalleryService))
|
|
496
|
-
], ExtensionManagementCLI));
|
|
426
|
+
ExtensionManagementCLI = ( (__decorate([
|
|
427
|
+
( (__param(1, IExtensionManagementService))),
|
|
428
|
+
( (__param(2, IExtensionGalleryService)))
|
|
429
|
+
], ExtensionManagementCLI)));
|
|
497
430
|
|
|
498
431
|
export { ExtensionManagementCLI };
|
package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js
CHANGED
|
@@ -28,7 +28,7 @@ let ExtensionResourceLoaderService = class ExtensionResourceLoaderService extend
|
|
|
28
28
|
const response = await fetch(( uri.toString(true)), requestInit);
|
|
29
29
|
if (response.status !== 200) {
|
|
30
30
|
this._logService.info(`Request to '${( uri.toString(true))}' failed with status code ${response.status}`);
|
|
31
|
-
throw new Error(response.statusText);
|
|
31
|
+
throw ( new Error(response.statusText));
|
|
32
32
|
}
|
|
33
33
|
return response.text();
|
|
34
34
|
}
|
|
@@ -16,6 +16,7 @@ import { getAuthenticationProviderActivationEvent } from 'vscode/vscode/vs/workb
|
|
|
16
16
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
17
17
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
18
18
|
|
|
19
|
+
const _moduleId = "vs/workbench/api/browser/mainThreadAuthentication";
|
|
19
20
|
class MainThreadAuthenticationProvider extends Disposable {
|
|
20
21
|
constructor(_proxy, id, label, supportsMultipleAccounts, notificationService, onDidChangeSessionsEmitter) {
|
|
21
22
|
super();
|
|
@@ -34,11 +35,7 @@ class MainThreadAuthenticationProvider extends Disposable {
|
|
|
34
35
|
}
|
|
35
36
|
async removeSession(sessionId) {
|
|
36
37
|
await this._proxy.$removeSession(this.id, sessionId);
|
|
37
|
-
this.notificationService.info(( localizeWithPath(
|
|
38
|
-
'vs/workbench/api/browser/mainThreadAuthentication',
|
|
39
|
-
'signedOut',
|
|
40
|
-
"Successfully signed out."
|
|
41
|
-
)));
|
|
38
|
+
this.notificationService.info(( localizeWithPath(_moduleId, 0, "Successfully signed out.")));
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
let MainThreadAuthentication = class MainThreadAuthentication extends Disposable {
|
|
@@ -53,23 +50,23 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
53
50
|
this.extensionService = extensionService;
|
|
54
51
|
this.telemetryService = telemetryService;
|
|
55
52
|
this.openerService = openerService;
|
|
56
|
-
this._registrations = this._register(( new DisposableMap()));
|
|
57
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostAuthentication));
|
|
53
|
+
this._registrations = this._register(( (new DisposableMap())));
|
|
54
|
+
this._proxy = ( (extHostContext.getProxy(ExtHostContext.ExtHostAuthentication)));
|
|
58
55
|
this._register(this.authenticationService.onDidChangeSessions(e => {
|
|
59
56
|
this._proxy.$onDidChangeAuthenticationSessions(e.providerId, e.label);
|
|
60
57
|
}));
|
|
61
58
|
}
|
|
62
59
|
async $registerAuthenticationProvider(id, label, supportsMultipleAccounts) {
|
|
63
|
-
const emitter = ( new Emitter());
|
|
60
|
+
const emitter = ( (new Emitter()));
|
|
64
61
|
this._registrations.set(id, emitter);
|
|
65
|
-
const provider = ( new MainThreadAuthenticationProvider(
|
|
62
|
+
const provider = ( (new MainThreadAuthenticationProvider(
|
|
66
63
|
this._proxy,
|
|
67
64
|
id,
|
|
68
65
|
label,
|
|
69
66
|
supportsMultipleAccounts,
|
|
70
67
|
this.notificationService,
|
|
71
68
|
emitter
|
|
72
|
-
));
|
|
69
|
+
)));
|
|
73
70
|
this.authenticationService.registerAuthenticationProvider(id, provider);
|
|
74
71
|
}
|
|
75
72
|
$unregisterAuthenticationProvider(id) {
|
|
@@ -93,26 +90,22 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
93
90
|
async loginPrompt(providerName, extensionName, recreatingSession, options) {
|
|
94
91
|
const message = recreatingSession
|
|
95
92
|
? ( localizeWithPath(
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
_moduleId,
|
|
94
|
+
1,
|
|
98
95
|
"The extension '{0}' wants you to sign in again using {1}.",
|
|
99
96
|
extensionName,
|
|
100
97
|
providerName
|
|
101
98
|
))
|
|
102
99
|
: ( localizeWithPath(
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
_moduleId,
|
|
101
|
+
2,
|
|
105
102
|
"The extension '{0}' wants to sign in using {1}.",
|
|
106
103
|
extensionName,
|
|
107
104
|
providerName
|
|
108
105
|
));
|
|
109
106
|
const buttons = [
|
|
110
107
|
{
|
|
111
|
-
label: ( localizeWithPath(
|
|
112
|
-
'vs/workbench/api/browser/mainThreadAuthentication',
|
|
113
|
-
{ key: 'allow', comment: ['&& denotes a mnemonic'] },
|
|
114
|
-
"&&Allow"
|
|
115
|
-
)),
|
|
108
|
+
label: ( localizeWithPath(_moduleId, 3, "&&Allow")),
|
|
116
109
|
run() {
|
|
117
110
|
return true;
|
|
118
111
|
},
|
|
@@ -120,11 +113,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
120
113
|
];
|
|
121
114
|
if (options?.learnMore) {
|
|
122
115
|
buttons.push({
|
|
123
|
-
label: ( localizeWithPath(
|
|
124
|
-
'vs/workbench/api/browser/mainThreadAuthentication',
|
|
125
|
-
'learnMore',
|
|
126
|
-
"Learn more"
|
|
127
|
-
)),
|
|
116
|
+
label: ( localizeWithPath(_moduleId, 4, "Learn more")),
|
|
128
117
|
run: async () => {
|
|
129
118
|
const result = this.loginPrompt(providerName, extensionName, recreatingSession, options);
|
|
130
119
|
await this.openerService.open(URI.revive(options.learnMore), { allowCommands: true });
|
|
@@ -145,13 +134,19 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
145
134
|
const sessions = await this.authenticationService.getSessions(providerId, scopes, true);
|
|
146
135
|
const provider = this.authenticationService.getProvider(providerId);
|
|
147
136
|
if (options.forceNewSession && options.createIfNone) {
|
|
148
|
-
throw new Error(
|
|
137
|
+
throw ( (new Error(
|
|
138
|
+
'Invalid combination of options. Please remove one of the following: forceNewSession, createIfNone'
|
|
139
|
+
)));
|
|
149
140
|
}
|
|
150
141
|
if (options.forceNewSession && options.silent) {
|
|
151
|
-
throw new Error(
|
|
142
|
+
throw ( (new Error(
|
|
143
|
+
'Invalid combination of options. Please remove one of the following: forceNewSession, silent'
|
|
144
|
+
)));
|
|
152
145
|
}
|
|
153
146
|
if (options.createIfNone && options.silent) {
|
|
154
|
-
throw new Error(
|
|
147
|
+
throw ( (new Error(
|
|
148
|
+
'Invalid combination of options. Please remove one of the following: createIfNone, silent'
|
|
149
|
+
)));
|
|
155
150
|
}
|
|
156
151
|
if (!options.forceNewSession && sessions.length) {
|
|
157
152
|
if (provider.supportsMultipleAccounts) {
|
|
@@ -180,7 +175,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
180
175
|
const recreatingSession = !!(options.forceNewSession && sessions.length);
|
|
181
176
|
const isAllowed = await this.loginPrompt(provider.label, extensionName, recreatingSession, uiOptions);
|
|
182
177
|
if (!isAllowed) {
|
|
183
|
-
throw new Error('User did not consent to login.');
|
|
178
|
+
throw ( (new Error('User did not consent to login.')));
|
|
184
179
|
}
|
|
185
180
|
let session;
|
|
186
181
|
if (sessions?.length && !options.forceNewSession) {
|
|
@@ -239,15 +234,15 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
239
234
|
};
|
|
240
235
|
MainThreadAuthentication = __decorate([
|
|
241
236
|
extHostNamedCustomer(MainContext.MainThreadAuthentication),
|
|
242
|
-
( __param(1, IAuthenticationService)),
|
|
243
|
-
( __param(2, IAuthenticationExtensionsService)),
|
|
244
|
-
( __param(3, IAuthenticationAccessService)),
|
|
245
|
-
( __param(4, IAuthenticationUsageService)),
|
|
246
|
-
( __param(5, IDialogService)),
|
|
247
|
-
( __param(6, INotificationService)),
|
|
248
|
-
( __param(7, IExtensionService)),
|
|
249
|
-
( __param(8, ITelemetryService)),
|
|
250
|
-
( __param(9, IOpenerService))
|
|
237
|
+
( (__param(1, IAuthenticationService))),
|
|
238
|
+
( (__param(2, IAuthenticationExtensionsService))),
|
|
239
|
+
( (__param(3, IAuthenticationAccessService))),
|
|
240
|
+
( (__param(4, IAuthenticationUsageService))),
|
|
241
|
+
( (__param(5, IDialogService))),
|
|
242
|
+
( (__param(6, INotificationService))),
|
|
243
|
+
( (__param(7, IExtensionService))),
|
|
244
|
+
( (__param(8, ITelemetryService))),
|
|
245
|
+
( (__param(9, IOpenerService)))
|
|
251
246
|
], MainThreadAuthentication);
|
|
252
247
|
|
|
253
248
|
export { MainThreadAuthentication, MainThreadAuthenticationProvider };
|
|
@@ -50,7 +50,7 @@ function reviveWorkspaceEditDto(data, uriIdentityService, resolveDataTransferFil
|
|
|
50
50
|
edit.options.contents = resolveDataTransferFile(inContents.id);
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
throw new Error('Could not revive data transfer file');
|
|
53
|
+
throw ( new Error('Could not revive data transfer file'));
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|