@codingame/monaco-vscode-extensions-service-override 9.0.3 → 10.0.1
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/_virtual/semver.js +5 -0
- package/assets/webWorkerExtensionHostIframe.esm.html +8 -4
- package/extensions.js +14 -5
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +1 -1
- package/package.json +3 -3
- package/vscode/src/vs/base/common/console.js +0 -2
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +35 -35
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +0 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +54 -31
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +1 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +4 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +57 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +9 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +9 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +16 -33
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +2 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +6 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +16 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +38 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +17 -19
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +39 -80
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +23 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +8 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +2 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +1 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +14 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +3 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +77 -42
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +23 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +3 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +1 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +17 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +3 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +4 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +14 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +11 -11
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +22 -10
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +1 -2
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +30 -33
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +19 -24
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +11 -15
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +32 -32
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +7 -8
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +2 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +5 -5
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +7 -9
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta http-equiv="Content-Security-Policy" content="
|
|
5
5
|
default-src 'none';
|
|
6
6
|
child-src 'self' data: blob:;
|
|
7
|
-
script-src 'self' 'unsafe-eval' 'sha256-
|
|
7
|
+
script-src 'self' 'unsafe-eval' 'sha256-fCnZ3iXydTZHO961jO3ioYDdWSfm8PZg/rI6zFX/SE0=' https: http://localhost:* blob:;
|
|
8
8
|
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -95,13 +95,17 @@
|
|
|
95
95
|
|
|
96
96
|
const isESM = true;
|
|
97
97
|
|
|
98
|
+
// In below blob code, we are using JSON.stringify to ensure the passed
|
|
99
|
+
// in values are not breaking our script. The values may contain string
|
|
100
|
+
// terminating characters (such as ' or ").
|
|
101
|
+
|
|
98
102
|
const blob = new Blob([[
|
|
99
103
|
`/*extensionHostWorker*/`,
|
|
100
|
-
`globalThis.MonacoEnvironment = { baseUrl:
|
|
104
|
+
`globalThis.MonacoEnvironment = { baseUrl: ${JSON.stringify(baseUrl)} };`,
|
|
101
105
|
`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(nlsMessages)};`,
|
|
102
106
|
`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(nlsLanguage)};`,
|
|
103
|
-
`globalThis._VSCODE_FILE_ROOT =
|
|
104
|
-
isESM ? `await import(
|
|
107
|
+
`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(fileRoot)};`,
|
|
108
|
+
isESM ? `await import(${JSON.stringify(workerUrl)});` : `importScripts(${JSON.stringify(workerUrl)});`,
|
|
105
109
|
`/*extensionHostWorker*/`
|
|
106
110
|
].join('')], { type: 'application/javascript' });
|
|
107
111
|
|
package/extensions.js
CHANGED
|
@@ -40,6 +40,7 @@ import './vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js';
|
|
|
40
40
|
import './vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js';
|
|
41
41
|
import './vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js';
|
|
42
42
|
import './vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js';
|
|
43
|
+
import './vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js';
|
|
43
44
|
import './vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js';
|
|
44
45
|
import './vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js';
|
|
45
46
|
import './vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js';
|
|
@@ -58,12 +59,12 @@ import './vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js';
|
|
|
58
59
|
import 'vscode/vscode/vs/base/common/event';
|
|
59
60
|
import 'vscode/vscode/vs/base/common/lifecycle';
|
|
60
61
|
import 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
61
|
-
import 'vscode/vscode/vs/editor/common/core/selection';
|
|
62
|
-
import 'vscode/vscode/vs/editor/common/editorCommon';
|
|
63
62
|
import 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
64
63
|
import 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
65
64
|
import 'vscode/vscode/vs/base/common/arrays';
|
|
66
|
-
import 'vscode/vscode/vs/
|
|
65
|
+
import 'vscode/vscode/vs/base/common/strings';
|
|
66
|
+
import 'vscode/vscode/vs/base/common/cancellation';
|
|
67
|
+
import 'vscode/vscode/vs/editor/contrib/editorState/browser/keybindingCancellation';
|
|
67
68
|
import 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetParser';
|
|
68
69
|
import './vscode/src/vs/workbench/api/browser/mainThreadEditors.js';
|
|
69
70
|
import './vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js';
|
|
@@ -139,7 +140,9 @@ let BrowserExtensionHostFactoryOverride = class BrowserExtensionHostFactoryOverr
|
|
|
139
140
|
if (!this.workerExtHostEnabled) {
|
|
140
141
|
return null;
|
|
141
142
|
}
|
|
142
|
-
const startup =
|
|
143
|
+
const startup = isInitialStart
|
|
144
|
+
? 2
|
|
145
|
+
: 1 ;
|
|
143
146
|
return this._instantiationService.createInstance(WebWorkerExtensionHost, runningLocation, startup, this._createLocalExtensionHostDataProvider(runningLocations, runningLocation, isInitialStart));
|
|
144
147
|
}
|
|
145
148
|
case 3 : {
|
|
@@ -179,7 +182,13 @@ let ExtensionServiceOverride = class ExtensionServiceOverride extends ExtensionS
|
|
|
179
182
|
constructor(workerExtHostEnabled, instantiationService, notificationService, browserEnvironmentService, telemetryService, extensionEnablementService, fileService, productService, extensionManagementService, contextService, configurationService, extensionManifestPropertiesService, webExtensionsScannerService, logService, remoteAgentService, remoteExtensionsScannerService, lifecycleService, remoteAuthorityResolverService, userDataInitializationService, userDataProfileService, workspaceTrustManagementService, remoteExplorerService, dialogService) {
|
|
180
183
|
const extensionsProposedApi = instantiationService.createInstance(ExtensionsProposedApi);
|
|
181
184
|
const extensionHostFactory = new BrowserExtensionHostFactoryOverride(workerExtHostEnabled, extensionsProposedApi, async () => await this._scanWebExtensions(), () => this._getExtensionRegistrySnapshotWhenReady(), instantiationService, remoteAgentService, remoteAuthorityResolverService, extensionEnablementService, logService);
|
|
182
|
-
super(extensionsProposedApi, extensionHostFactory, new LocalBrowserExtensionHostKindPicker(workerExtHostEnabled
|
|
185
|
+
super(extensionsProposedApi, extensionHostFactory, new LocalBrowserExtensionHostKindPicker(workerExtHostEnabled
|
|
186
|
+
? [
|
|
187
|
+
2 ,
|
|
188
|
+
1 ,
|
|
189
|
+
3
|
|
190
|
+
]
|
|
191
|
+
: [1 , 3 ], logService), instantiationService, notificationService, browserEnvironmentService, telemetryService, extensionEnablementService, fileService, productService, extensionManagementService, contextService, configurationService, extensionManifestPropertiesService, webExtensionsScannerService, logService, remoteAgentService, remoteExtensionsScannerService, lifecycleService, remoteAuthorityResolverService, userDataInitializationService, userDataProfileService, workspaceTrustManagementService, remoteExplorerService, dialogService);
|
|
183
192
|
}
|
|
184
193
|
async deltaExtensions(toAdd, toRemove) {
|
|
185
194
|
await this._handleDeltaExtensions(new DeltaExtensionsQueueItem(toAdd, toRemove));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let AbstractTextEditor = class {};
|
|
2
2
|
class FakeAbstractTextEditor {
|
|
3
3
|
static [Symbol.hasInstance](instance) {
|
|
4
|
-
|
|
4
|
+
return AbstractTextEditor != null && instance instanceof AbstractTextEditor
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
function setAbstractTextEditor(_AbstractTextEditor) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extensions-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
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@
|
|
30
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.1",
|
|
30
|
+
"@codingame/monaco-vscode-files-service-override": "10.0.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -3,17 +3,17 @@ import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
|
3
3
|
import { getErrorMessage, isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
4
4
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
5
5
|
import { basename } from 'vscode/vscode/vs/base/common/resources';
|
|
6
|
-
import { semverExports } from '
|
|
6
|
+
import { semverExports } from '../../../../../../_virtual/semver.js';
|
|
7
7
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
8
8
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
9
|
-
import {
|
|
9
|
+
import { EXTENSION_IDENTIFIER_REGEX } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
10
10
|
import { IExtensionManagementService, IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
11
11
|
import { getIdAndVersion, areSameExtensions, getGalleryExtensionId, getExtensionId } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
12
|
-
import {
|
|
12
|
+
import { EXTENSION_CATEGORIES } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
13
13
|
|
|
14
|
-
const notFound = (id) => ( localize(
|
|
14
|
+
const notFound = (id) => ( localize(9904, "Extension '{0}' not found.", id));
|
|
15
15
|
const useId = ( localize(
|
|
16
|
-
|
|
16
|
+
9905,
|
|
17
17
|
"Make sure you use the full extension ID, including the publisher, e.g.: {0}",
|
|
18
18
|
'ms-dotnettools.csharp'
|
|
19
19
|
));
|
|
@@ -27,7 +27,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
27
27
|
return undefined;
|
|
28
28
|
}
|
|
29
29
|
async listExtensions(showVersions, category, profileLocation) {
|
|
30
|
-
let extensions = await this.extensionManagementService.getInstalled(
|
|
30
|
+
let extensions = await this.extensionManagementService.getInstalled(1 , profileLocation);
|
|
31
31
|
const categories = ( (EXTENSION_CATEGORIES.map(c => c.toLowerCase())));
|
|
32
32
|
if (category && category !== '') {
|
|
33
33
|
if (categories.indexOf(category.toLowerCase()) < 0) {
|
|
@@ -50,7 +50,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
if (this.location) {
|
|
53
|
-
this.logger.info(( localize(
|
|
53
|
+
this.logger.info(( localize(9906, "Extensions installed on {0}:", this.location)));
|
|
54
54
|
}
|
|
55
55
|
extensions = extensions.sort((e1, e2) => e1.identifier.id.localeCompare(e2.identifier.id));
|
|
56
56
|
let lastId = undefined;
|
|
@@ -65,7 +65,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
65
65
|
const failed = [];
|
|
66
66
|
try {
|
|
67
67
|
if (extensions.length) {
|
|
68
|
-
this.logger.info(this.location ? ( localize(
|
|
68
|
+
this.logger.info(this.location ? ( localize(9907, "Installing extensions on {0}...", this.location)) : ( localize(9908, "Installing extensions...")));
|
|
69
69
|
}
|
|
70
70
|
const installVSIXInfos = [];
|
|
71
71
|
const installExtensionInfos = [];
|
|
@@ -108,15 +108,15 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
catch (error) {
|
|
111
|
-
this.logger.error(( localize(
|
|
111
|
+
this.logger.error(( localize(9909, "Error while installing extensions: {0}", getErrorMessage(error))));
|
|
112
112
|
throw error;
|
|
113
113
|
}
|
|
114
114
|
if (failed.length) {
|
|
115
|
-
throw ( (new Error(localize(
|
|
115
|
+
throw ( (new Error(localize(9910, "Failed Installing Extensions: {0}", failed.join(', ')))));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
async updateExtensions(profileLocation) {
|
|
119
|
-
const installedExtensions = await this.extensionManagementService.getInstalled(
|
|
119
|
+
const installedExtensions = await this.extensionManagementService.getInstalled(1 , profileLocation);
|
|
120
120
|
const installedExtensionsQuery = [];
|
|
121
121
|
for (const extension of installedExtensions) {
|
|
122
122
|
if (!!extension.identifier.uuid) {
|
|
@@ -124,7 +124,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
this.logger.trace(( localize(
|
|
127
|
-
|
|
127
|
+
9911,
|
|
128
128
|
"Fetching latest versions for {0} extensions",
|
|
129
129
|
installedExtensionsQuery.length
|
|
130
130
|
)));
|
|
@@ -135,17 +135,17 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
135
135
|
if (areSameExtensions(oldVersion.identifier, newVersion.identifier) && semverExports.gt(newVersion.version, oldVersion.manifest.version)) {
|
|
136
136
|
extensionsToUpdate.push({
|
|
137
137
|
extension: newVersion,
|
|
138
|
-
options: { operation:
|
|
138
|
+
options: { operation: 3 , installPreReleaseVersion: oldVersion.preRelease, profileLocation, isApplicationScoped: oldVersion.isApplicationScoped }
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
if (!extensionsToUpdate.length) {
|
|
144
|
-
this.logger.info(( localize(
|
|
144
|
+
this.logger.info(( localize(9912, "No extension to update")));
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
this.logger.info(( localize(
|
|
148
|
-
|
|
148
|
+
9913,
|
|
149
149
|
"Updating extensions: {0}",
|
|
150
150
|
( (extensionsToUpdate.map(ext => ext.extension.identifier.id))).join(', ')
|
|
151
151
|
)));
|
|
@@ -153,7 +153,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
153
153
|
for (const extensionResult of installationResult) {
|
|
154
154
|
if (extensionResult.error) {
|
|
155
155
|
this.logger.error(( localize(
|
|
156
|
-
|
|
156
|
+
9914,
|
|
157
157
|
"Error while updating extension {0}: {1}",
|
|
158
158
|
extensionResult.identifier.id,
|
|
159
159
|
getErrorMessage(extensionResult.error)
|
|
@@ -161,7 +161,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
163
|
this.logger.info(( localize(
|
|
164
|
-
|
|
164
|
+
9915,
|
|
165
165
|
"Extension '{0}' v{1} was successfully updated.",
|
|
166
166
|
extensionResult.identifier.id,
|
|
167
167
|
extensionResult.local?.manifest.version
|
|
@@ -175,7 +175,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
175
175
|
if (installedExtension) {
|
|
176
176
|
if (!force && (!version || (version === 'prerelease' && installedExtension.preRelease))) {
|
|
177
177
|
this.logger.info(( localize(
|
|
178
|
-
|
|
178
|
+
9916,
|
|
179
179
|
"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'.",
|
|
180
180
|
id,
|
|
181
181
|
installedExtension.manifest.version,
|
|
@@ -184,7 +184,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
184
184
|
return false;
|
|
185
185
|
}
|
|
186
186
|
if (version && installedExtension.manifest.version === version) {
|
|
187
|
-
this.logger.info(( localize(
|
|
187
|
+
this.logger.info(( localize(9917, "Extension '{0}' is already installed.", `${id}@${version}`)));
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -218,24 +218,24 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
218
218
|
if (installedExtension) {
|
|
219
219
|
if (gallery.version === installedExtension.manifest.version) {
|
|
220
220
|
this.logger.info(( localize(
|
|
221
|
-
|
|
221
|
+
9917,
|
|
222
222
|
"Extension '{0}' is already installed.",
|
|
223
223
|
version ? `${id}@${version}` : id
|
|
224
224
|
)));
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
227
|
this.logger.info(( localize(
|
|
228
|
-
|
|
228
|
+
9918,
|
|
229
229
|
"Updating the extension '{0}' to the version {1}",
|
|
230
230
|
id,
|
|
231
231
|
gallery.version
|
|
232
232
|
)));
|
|
233
233
|
}
|
|
234
234
|
if (installOptions.isBuiltin) {
|
|
235
|
-
this.logger.info(version ? ( localize(
|
|
235
|
+
this.logger.info(version ? ( localize(9919, "Installing builtin extension '{0}' v{1}...", id, version)) : ( localize(9920, "Installing builtin extension '{0}'...", id)));
|
|
236
236
|
}
|
|
237
237
|
else {
|
|
238
|
-
this.logger.info(version ? ( localize(
|
|
238
|
+
this.logger.info(version ? ( localize(9921, "Installing extension '{0}' v{1}...", id, version)) : ( localize(9922, "Installing extension '{0}'...", id)));
|
|
239
239
|
}
|
|
240
240
|
extensionsToInstall.push({
|
|
241
241
|
extension: gallery,
|
|
@@ -247,7 +247,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
247
247
|
for (const extensionResult of installationResult) {
|
|
248
248
|
if (extensionResult.error) {
|
|
249
249
|
this.logger.error(( localize(
|
|
250
|
-
|
|
250
|
+
9923,
|
|
251
251
|
"Error while installing extension {0}: {1}",
|
|
252
252
|
extensionResult.identifier.id,
|
|
253
253
|
getErrorMessage(extensionResult.error)
|
|
@@ -256,7 +256,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
256
256
|
}
|
|
257
257
|
else {
|
|
258
258
|
this.logger.info(( localize(
|
|
259
|
-
|
|
259
|
+
9924,
|
|
260
260
|
"Extension '{0}' v{1} was successfully installed.",
|
|
261
261
|
extensionResult.identifier.id,
|
|
262
262
|
extensionResult.local?.manifest.version
|
|
@@ -275,11 +275,11 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
275
275
|
if (valid) {
|
|
276
276
|
try {
|
|
277
277
|
await this.extensionManagementService.install(vsix, { ...installOptions, installGivenVersion: true });
|
|
278
|
-
this.logger.info(( localize(
|
|
278
|
+
this.logger.info(( localize(9925, "Extension '{0}' was successfully installed.", basename(vsix))));
|
|
279
279
|
}
|
|
280
280
|
catch (error) {
|
|
281
281
|
if (isCancellationError(error)) {
|
|
282
|
-
this.logger.info(( localize(
|
|
282
|
+
this.logger.info(( localize(9926, "Cancelled installing extension '{0}'.", basename(vsix))));
|
|
283
283
|
}
|
|
284
284
|
else {
|
|
285
285
|
throw error;
|
|
@@ -314,7 +314,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
314
314
|
const newer = installedExtensions.find(local => areSameExtensions(extensionIdentifier, local.identifier) && semverExports.gt(local.manifest.version, manifest.version));
|
|
315
315
|
if (newer) {
|
|
316
316
|
this.logger.info(( localize(
|
|
317
|
-
|
|
317
|
+
9927,
|
|
318
318
|
"A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",
|
|
319
319
|
newer.identifier.id,
|
|
320
320
|
newer.manifest.version,
|
|
@@ -340,9 +340,9 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
340
340
|
if (!extensionsToUninstall.length) {
|
|
341
341
|
throw ( (new Error(`${this.notInstalled(id)}\n${useId}`)));
|
|
342
342
|
}
|
|
343
|
-
if (( (extensionsToUninstall.some(e => e.type ===
|
|
343
|
+
if (( (extensionsToUninstall.some(e => e.type === 0 )))) {
|
|
344
344
|
this.logger.info(( localize(
|
|
345
|
-
|
|
345
|
+
9928,
|
|
346
346
|
"Extension '{0}' is a Built-in extension and cannot be uninstalled",
|
|
347
347
|
id
|
|
348
348
|
)));
|
|
@@ -350,26 +350,26 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
350
350
|
}
|
|
351
351
|
if (!force && ( (extensionsToUninstall.some(e => e.isBuiltin)))) {
|
|
352
352
|
this.logger.info(( localize(
|
|
353
|
-
|
|
353
|
+
9929,
|
|
354
354
|
"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",
|
|
355
355
|
id
|
|
356
356
|
)));
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
|
-
this.logger.info(( localize(
|
|
359
|
+
this.logger.info(( localize(9930, "Uninstalling {0}...", id)));
|
|
360
360
|
for (const extensionToUninstall of extensionsToUninstall) {
|
|
361
361
|
await this.extensionManagementService.uninstall(extensionToUninstall, { profileLocation });
|
|
362
362
|
}
|
|
363
363
|
if (this.location) {
|
|
364
364
|
this.logger.info(( localize(
|
|
365
|
-
|
|
365
|
+
9931,
|
|
366
366
|
"Extension '{0}' was successfully uninstalled from {1}!",
|
|
367
367
|
id,
|
|
368
368
|
this.location
|
|
369
369
|
)));
|
|
370
370
|
}
|
|
371
371
|
else {
|
|
372
|
-
this.logger.info(( localize(
|
|
372
|
+
this.logger.info(( localize(9932, "Extension '{0}' was successfully uninstalled!", id)));
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -387,7 +387,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
389
|
notInstalled(id) {
|
|
390
|
-
return this.location ? ( localize(
|
|
390
|
+
return this.location ? ( localize(9933, "Extension '{0}' is not installed on {1}.", id, this.location)) : ( localize(9934, "Extension '{0}' is not installed.", id));
|
|
391
391
|
}
|
|
392
392
|
};
|
|
393
393
|
ExtensionManagementCLI = ( (__decorate([
|
package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
3
2
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
4
3
|
import { FileAccess, Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
5
4
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
@@ -8,7 +8,6 @@ import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/comm
|
|
|
8
8
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
9
9
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
10
10
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
11
|
-
import { ActivationKind } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
12
11
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
13
12
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
14
13
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
@@ -37,7 +36,7 @@ class MainThreadAuthenticationProvider extends Disposable {
|
|
|
37
36
|
}
|
|
38
37
|
async removeSession(sessionId) {
|
|
39
38
|
await this._proxy.$removeSession(this.id, sessionId);
|
|
40
|
-
this.notificationService.info(( localize(
|
|
39
|
+
this.notificationService.info(( localize(4883, "Successfully signed out.")));
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
let MainThreadAuthentication = class MainThreadAuthentication extends Disposable {
|
|
@@ -57,6 +56,10 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
57
56
|
this._register(this.authenticationService.onDidChangeSessions(e => {
|
|
58
57
|
this._proxy.$onDidChangeAuthenticationSessions(e.providerId, e.label);
|
|
59
58
|
}));
|
|
59
|
+
this._register(this.authenticationExtensionsService.onDidChangeAccountPreference(e => {
|
|
60
|
+
const providerInfo = this.authenticationService.getProvider(e.providerId);
|
|
61
|
+
this._proxy.$onDidChangeAuthenticationSessions(providerInfo.id, providerInfo.label, e.extensionIds);
|
|
62
|
+
}));
|
|
60
63
|
}
|
|
61
64
|
async $registerAuthenticationProvider(id, label, supportsMultipleAccounts) {
|
|
62
65
|
const emitter = ( (new Emitter()));
|
|
@@ -77,7 +80,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
77
80
|
}
|
|
78
81
|
async $ensureProvider(id) {
|
|
79
82
|
if (!this.authenticationService.isAuthenticationProviderRegistered(id)) {
|
|
80
|
-
return await this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id),
|
|
83
|
+
return await this.extensionService.activateByEvent(getAuthenticationProviderActivationEvent(id), 1 );
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
$sendDidChangeSessions(providerId, event) {
|
|
@@ -93,7 +96,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
93
96
|
let message;
|
|
94
97
|
if (provider.id.startsWith(INTERNAL_AUTH_PROVIDER_PREFIX)) {
|
|
95
98
|
message = ( localize(
|
|
96
|
-
|
|
99
|
+
4884,
|
|
97
100
|
"The extension '{0}' wants to access the language models provided by {1}.",
|
|
98
101
|
extensionName,
|
|
99
102
|
provider.label
|
|
@@ -102,13 +105,13 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
102
105
|
else {
|
|
103
106
|
message = recreatingSession
|
|
104
107
|
? ( localize(
|
|
105
|
-
|
|
108
|
+
4885,
|
|
106
109
|
"The extension '{0}' wants you to sign in again using {1}.",
|
|
107
110
|
extensionName,
|
|
108
111
|
provider.label
|
|
109
112
|
))
|
|
110
113
|
: ( localize(
|
|
111
|
-
|
|
114
|
+
4886,
|
|
112
115
|
"The extension '{0}' wants to sign in using {1}.",
|
|
113
116
|
extensionName,
|
|
114
117
|
provider.label
|
|
@@ -116,7 +119,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
116
119
|
}
|
|
117
120
|
const buttons = [
|
|
118
121
|
{
|
|
119
|
-
label: ( localize(
|
|
122
|
+
label: ( localize(4887, "&&Allow")),
|
|
120
123
|
run() {
|
|
121
124
|
return true;
|
|
122
125
|
},
|
|
@@ -124,7 +127,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
124
127
|
];
|
|
125
128
|
if (options?.learnMore) {
|
|
126
129
|
buttons.push({
|
|
127
|
-
label: ( localize(
|
|
130
|
+
label: ( localize(4888, "Learn more")),
|
|
128
131
|
run: async () => {
|
|
129
132
|
const result = this.loginPrompt(provider, extensionName, recreatingSession, options);
|
|
130
133
|
await this.openerService.open(URI.revive(options.learnMore), { allowCommands: true });
|
|
@@ -143,9 +146,9 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
143
146
|
}
|
|
144
147
|
async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
|
|
145
148
|
const result = await this.dialogService.prompt({
|
|
146
|
-
message: ( localize(
|
|
149
|
+
message: ( localize(4889, "Incorrect account detected")),
|
|
147
150
|
detail: ( localize(
|
|
148
|
-
|
|
151
|
+
4890,
|
|
149
152
|
"The chosen account, {0}, does not match the requested account, {1}.",
|
|
150
153
|
chosenAccountLabel,
|
|
151
154
|
requestedAccountLabel
|
|
@@ -154,11 +157,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
154
157
|
cancelButton: true,
|
|
155
158
|
buttons: [
|
|
156
159
|
{
|
|
157
|
-
label: ( localize(
|
|
160
|
+
label: ( localize(4891, 'Keep {0}', chosenAccountLabel)),
|
|
158
161
|
run: () => chosenAccountLabel
|
|
159
162
|
},
|
|
160
163
|
{
|
|
161
|
-
label: ( localize(
|
|
164
|
+
label: ( localize(4892, 'Login with {0}', requestedAccountLabel)),
|
|
162
165
|
run: () => requestedAccountLabel
|
|
163
166
|
}
|
|
164
167
|
],
|
|
@@ -187,19 +190,14 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
187
190
|
)));
|
|
188
191
|
}
|
|
189
192
|
if (options.clearSessionPreference) {
|
|
190
|
-
this.
|
|
193
|
+
this._removeAccountPreference(extensionId, providerId, scopes);
|
|
191
194
|
}
|
|
195
|
+
const matchingAccountPreferenceSession = this._getAccountPreference(extensionId, providerId, scopes, sessions);
|
|
192
196
|
if (!options.forceNewSession && sessions.length) {
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
if (existingSessionPreference) {
|
|
196
|
-
const matchingSession = sessions.find(session => session.id === existingSessionPreference);
|
|
197
|
-
if (matchingSession && this.authenticationAccessService.isAccessAllowed(providerId, matchingSession.account.label, extensionId)) {
|
|
198
|
-
return matchingSession;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
197
|
+
if (matchingAccountPreferenceSession && this.authenticationAccessService.isAccessAllowed(providerId, matchingAccountPreferenceSession.account.label, extensionId)) {
|
|
198
|
+
return matchingAccountPreferenceSession;
|
|
201
199
|
}
|
|
202
|
-
|
|
200
|
+
if (!provider.supportsMultipleAccounts && this.authenticationAccessService.isAccessAllowed(providerId, sessions[0].account.label, extensionId)) {
|
|
203
201
|
return sessions[0];
|
|
204
202
|
}
|
|
205
203
|
}
|
|
@@ -220,11 +218,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
220
218
|
: sessions[0];
|
|
221
219
|
}
|
|
222
220
|
else {
|
|
223
|
-
|
|
224
|
-
if (!accountToCreate) {
|
|
225
|
-
const sessionIdToRecreate = this.authenticationExtensionsService.getSessionPreference(providerId, extensionId, scopes);
|
|
226
|
-
accountToCreate = sessionIdToRecreate ? sessions.find(session => session.id === sessionIdToRecreate)?.account : undefined;
|
|
227
|
-
}
|
|
221
|
+
const accountToCreate = options.account ?? matchingAccountPreferenceSession?.account;
|
|
228
222
|
do {
|
|
229
223
|
session = await this.authenticationService.createSession(providerId, scopes, { activateImmediate: true, account: accountToCreate });
|
|
230
224
|
} while (accountToCreate
|
|
@@ -232,12 +226,14 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
232
226
|
&& !(await this.continueWithIncorrectAccountPrompt(session.account.label, accountToCreate.label)));
|
|
233
227
|
}
|
|
234
228
|
this.authenticationAccessService.updateAllowedExtensions(providerId, session.account.label, [{ id: extensionId, name: extensionName, allowed: true }]);
|
|
235
|
-
this.
|
|
229
|
+
this._updateAccountPreference(extensionId, providerId, session);
|
|
236
230
|
return session;
|
|
237
231
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
232
|
+
if (!matchingAccountPreferenceSession && !this.authenticationExtensionsService.getAccountPreference(extensionId, providerId)) {
|
|
233
|
+
const validSession = sessions.find(session => this.authenticationAccessService.isAccessAllowed(providerId, session.account.label, extensionId));
|
|
234
|
+
if (validSession) {
|
|
235
|
+
return validSession;
|
|
236
|
+
}
|
|
241
237
|
}
|
|
242
238
|
if (!options.silent) {
|
|
243
239
|
sessions.length
|
|
@@ -261,6 +257,33 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
261
257
|
sendProviderUsageTelemetry(extensionId, providerId) {
|
|
262
258
|
this.telemetryService.publicLog2('authentication.providerUsage', { providerId, extensionId });
|
|
263
259
|
}
|
|
260
|
+
_getAccountPreference(extensionId, providerId, scopes, sessions) {
|
|
261
|
+
if (sessions.length === 0) {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
const accountNamePreference = this.authenticationExtensionsService.getAccountPreference(extensionId, providerId);
|
|
265
|
+
if (accountNamePreference) {
|
|
266
|
+
const session = sessions.find(session => session.account.label === accountNamePreference);
|
|
267
|
+
return session;
|
|
268
|
+
}
|
|
269
|
+
const sessionIdPreference = this.authenticationExtensionsService.getSessionPreference(providerId, extensionId, scopes);
|
|
270
|
+
if (sessionIdPreference) {
|
|
271
|
+
const session = sessions.find(session => session.id === sessionIdPreference);
|
|
272
|
+
if (session) {
|
|
273
|
+
this.authenticationExtensionsService.updateAccountPreference(extensionId, providerId, session.account);
|
|
274
|
+
return session;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return undefined;
|
|
278
|
+
}
|
|
279
|
+
_updateAccountPreference(extensionId, providerId, session) {
|
|
280
|
+
this.authenticationExtensionsService.updateAccountPreference(extensionId, providerId, session.account);
|
|
281
|
+
this.authenticationExtensionsService.updateSessionPreference(providerId, extensionId, session);
|
|
282
|
+
}
|
|
283
|
+
_removeAccountPreference(extensionId, providerId, scopes) {
|
|
284
|
+
this.authenticationExtensionsService.removeAccountPreference(extensionId, providerId);
|
|
285
|
+
this.authenticationExtensionsService.removeSessionPreference(providerId, extensionId, scopes);
|
|
286
|
+
}
|
|
264
287
|
};
|
|
265
288
|
MainThreadAuthentication = __decorate([
|
|
266
289
|
extHostNamedCustomer(MainContext.MainThreadAuthentication),
|
|
@@ -6,7 +6,6 @@ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
|
6
6
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
7
7
|
import { MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
8
8
|
import { ResourceNotebookCellEdit } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
|
9
|
-
import { CellEditType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
10
9
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
11
10
|
|
|
12
11
|
let MainThreadBulkEdits = class MainThreadBulkEdits {
|
|
@@ -62,7 +61,7 @@ function reviveWorkspaceEditDto(data, uriIdentityService, resolveDataTransferFil
|
|
|
62
61
|
if (ResourceNotebookCellEdit.is(edit)) {
|
|
63
62
|
edit.resource = uriIdentityService.asCanonicalUri(edit.resource);
|
|
64
63
|
const cellEdit = edit.cellEdit;
|
|
65
|
-
if (cellEdit.editType ===
|
|
64
|
+
if (cellEdit.editType === 1 ) {
|
|
66
65
|
edit.cellEdit = {
|
|
67
66
|
...cellEdit,
|
|
68
67
|
cells: ( cellEdit.cells.map(cell => ({
|
|
@@ -85,7 +85,7 @@ let RemoteExtensionManagementCLI = class RemoteExtensionManagementCLI extends Ex
|
|
|
85
85
|
if (!this._extensionManifestPropertiesService.canExecuteOnWorkspace(manifest)
|
|
86
86
|
&& !(isWeb && this._extensionManifestPropertiesService.canExecuteOnWeb(manifest))) {
|
|
87
87
|
this.logger.info(( localize(
|
|
88
|
-
|
|
88
|
+
4834,
|
|
89
89
|
"Cannot install the '{0}' extension because it is declared to not run in this setup.",
|
|
90
90
|
getExtensionId(manifest.publisher, manifest.name)
|
|
91
91
|
)));
|