@codingame/monaco-vscode-extensions-service-override 22.1.9 → 23.0.0
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.js +1 -0
- package/package.json +30 -29
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +28 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +47 -41
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +52 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +16 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +43 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +23 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +133 -90
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.d.ts +6 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +8 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +21 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.d.ts +7 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +17 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +29 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +4 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +13 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.d.ts +24 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +172 -55
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +57 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +3 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.d.ts +1 -0
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +6 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +1 -1
|
@@ -20,6 +20,7 @@ import { IAuthenticationMcpAccessService } from '@codingame/monaco-vscode-api/vs
|
|
|
20
20
|
import { IAuthenticationMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpService.service';
|
|
21
21
|
import { IAuthenticationMcpUsageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpUsageService.service';
|
|
22
22
|
import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
23
|
+
import { IDynamicAuthenticationProviderStorageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service';
|
|
23
24
|
import { ExtensionHostKind, extensionHostKindToString } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionHostKind';
|
|
24
25
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
25
26
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
@@ -27,7 +28,7 @@ import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode
|
|
|
27
28
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
28
29
|
|
|
29
30
|
let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
30
|
-
constructor(_extHostContext, _mcpRegistry, dialogService, _authenticationService, authenticationMcpServersService, authenticationMCPServerAccessService, authenticationMCPServerUsageService, _extensionService, _contextKeyService) {
|
|
31
|
+
constructor(_extHostContext, _mcpRegistry, dialogService, _authenticationService, authenticationMcpServersService, authenticationMCPServerAccessService, authenticationMCPServerUsageService, _dynamicAuthenticationProviderStorageService, _extensionService, _contextKeyService) {
|
|
31
32
|
super();
|
|
32
33
|
this._extHostContext = _extHostContext;
|
|
33
34
|
this._mcpRegistry = _mcpRegistry;
|
|
@@ -36,6 +37,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
36
37
|
this.authenticationMcpServersService = authenticationMcpServersService;
|
|
37
38
|
this.authenticationMCPServerAccessService = authenticationMCPServerAccessService;
|
|
38
39
|
this.authenticationMCPServerUsageService = authenticationMCPServerUsageService;
|
|
40
|
+
this._dynamicAuthenticationProviderStorageService = _dynamicAuthenticationProviderStorageService;
|
|
39
41
|
this._extensionService = _extensionService;
|
|
40
42
|
this._contextKeyService = _contextKeyService;
|
|
41
43
|
this._serverIdCounter = 0;
|
|
@@ -89,7 +91,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
89
91
|
const serverDefinitions = observableValue('mcpServers', servers);
|
|
90
92
|
const extensionId = ( new ExtensionIdentifier(collection.extensionId));
|
|
91
93
|
const store = ( new DisposableStore());
|
|
92
|
-
const handle = ( new MutableDisposable());
|
|
94
|
+
const handle = store.add(( new MutableDisposable()));
|
|
93
95
|
const register = () => {
|
|
94
96
|
handle.value ??= this._mcpRegistry.registerCollection({
|
|
95
97
|
...collection,
|
|
@@ -153,22 +155,27 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
153
155
|
$onDidReceiveMessage(id, message) {
|
|
154
156
|
this._servers.get(id)?.pushMessage(message);
|
|
155
157
|
}
|
|
156
|
-
async $getTokenFromServerMetadata(id,
|
|
158
|
+
async $getTokenFromServerMetadata(id, authDetails, { errorOnUserInteraction, forceNewRegistration } = {}) {
|
|
157
159
|
const server = this._serverDefinitions.get(id);
|
|
158
160
|
if (!server) {
|
|
159
161
|
return undefined;
|
|
160
162
|
}
|
|
161
|
-
const authorizationServer = URI.revive(
|
|
162
|
-
const
|
|
163
|
+
const authorizationServer = URI.revive(authDetails.authorizationServer);
|
|
164
|
+
const resolvedScopes = authDetails.scopes ?? authDetails.resourceMetadata?.scopes_supported ?? authDetails.authorizationServerMetadata.scopes_supported ?? [];
|
|
163
165
|
let providerId = await this._authenticationService.getOrActivateProviderIdForServer(authorizationServer);
|
|
166
|
+
if (forceNewRegistration && providerId) {
|
|
167
|
+
this._authenticationService.unregisterAuthenticationProvider(providerId);
|
|
168
|
+
await this._dynamicAuthenticationProviderStorageService.removeDynamicProvider(providerId);
|
|
169
|
+
providerId = undefined;
|
|
170
|
+
}
|
|
164
171
|
if (!providerId) {
|
|
165
|
-
const provider = await this._authenticationService.createDynamicAuthenticationProvider(authorizationServer,
|
|
172
|
+
const provider = await this._authenticationService.createDynamicAuthenticationProvider(authorizationServer, authDetails.authorizationServerMetadata, authDetails.resourceMetadata);
|
|
166
173
|
if (!provider) {
|
|
167
174
|
return undefined;
|
|
168
175
|
}
|
|
169
176
|
providerId = provider.id;
|
|
170
177
|
}
|
|
171
|
-
const sessions = await this._authenticationService.getSessions(providerId,
|
|
178
|
+
const sessions = await this._authenticationService.getSessions(providerId, resolvedScopes, { authorizationServer: authorizationServer }, true);
|
|
172
179
|
const accountNamePreference = this.authenticationMcpServersService.getAccountPreference(server.id, providerId);
|
|
173
180
|
let matchingAccountPreferenceSession;
|
|
174
181
|
if (accountNamePreference) {
|
|
@@ -178,11 +185,11 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
178
185
|
let session;
|
|
179
186
|
if (sessions.length) {
|
|
180
187
|
if (matchingAccountPreferenceSession && this.authenticationMCPServerAccessService.isAccessAllowed(providerId, matchingAccountPreferenceSession.account.label, server.id)) {
|
|
181
|
-
this.authenticationMCPServerUsageService.addAccountUsage(providerId, matchingAccountPreferenceSession.account.label,
|
|
188
|
+
this.authenticationMCPServerUsageService.addAccountUsage(providerId, matchingAccountPreferenceSession.account.label, resolvedScopes, server.id, server.label);
|
|
182
189
|
return matchingAccountPreferenceSession.accessToken;
|
|
183
190
|
}
|
|
184
191
|
if (!provider.supportsMultipleAccounts && this.authenticationMCPServerAccessService.isAccessAllowed(providerId, sessions[0].account.label, server.id)) {
|
|
185
|
-
this.authenticationMCPServerUsageService.addAccountUsage(providerId, sessions[0].account.label,
|
|
192
|
+
this.authenticationMCPServerUsageService.addAccountUsage(providerId, sessions[0].account.label, resolvedScopes, server.id, server.label);
|
|
186
193
|
return sessions[0].accessToken;
|
|
187
194
|
}
|
|
188
195
|
}
|
|
@@ -198,7 +205,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
198
205
|
throw ( new UserInteractionRequiredError('authentication'));
|
|
199
206
|
}
|
|
200
207
|
session = provider.supportsMultipleAccounts
|
|
201
|
-
? await this.authenticationMcpServersService.selectSession(providerId, server.id, server.label,
|
|
208
|
+
? await this.authenticationMcpServersService.selectSession(providerId, server.id, server.label, resolvedScopes, sessions)
|
|
202
209
|
: sessions[0];
|
|
203
210
|
}
|
|
204
211
|
else {
|
|
@@ -207,7 +214,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
207
214
|
}
|
|
208
215
|
const accountToCreate = matchingAccountPreferenceSession?.account;
|
|
209
216
|
do {
|
|
210
|
-
session = await this._authenticationService.createSession(providerId,
|
|
217
|
+
session = await this._authenticationService.createSession(providerId, resolvedScopes, {
|
|
211
218
|
activateImmediate: true,
|
|
212
219
|
account: accountToCreate,
|
|
213
220
|
authorizationServer
|
|
@@ -218,14 +225,14 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
218
225
|
}
|
|
219
226
|
this.authenticationMCPServerAccessService.updateAllowedMcpServers(providerId, session.account.label, [{ id: server.id, name: server.label, allowed: true }]);
|
|
220
227
|
this.authenticationMcpServersService.updateAccountPreference(server.id, providerId, session.account);
|
|
221
|
-
this.authenticationMCPServerUsageService.addAccountUsage(providerId, session.account.label,
|
|
228
|
+
this.authenticationMCPServerUsageService.addAccountUsage(providerId, session.account.label, resolvedScopes, server.id, server.label);
|
|
222
229
|
return session.accessToken;
|
|
223
230
|
}
|
|
224
231
|
async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
|
|
225
232
|
const result = await this.dialogService.prompt({
|
|
226
|
-
message: ( localize(
|
|
233
|
+
message: ( localize(2503, "Incorrect account detected")),
|
|
227
234
|
detail: ( localize(
|
|
228
|
-
|
|
235
|
+
2504,
|
|
229
236
|
"The chosen account, {0}, does not match the requested account, {1}.",
|
|
230
237
|
chosenAccountLabel,
|
|
231
238
|
requestedAccountLabel
|
|
@@ -234,11 +241,11 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
234
241
|
cancelButton: true,
|
|
235
242
|
buttons: [
|
|
236
243
|
{
|
|
237
|
-
label: ( localize(
|
|
244
|
+
label: ( localize(2505, 'Keep {0}', chosenAccountLabel)),
|
|
238
245
|
run: () => chosenAccountLabel
|
|
239
246
|
},
|
|
240
247
|
{
|
|
241
|
-
label: ( localize(
|
|
248
|
+
label: ( localize(2506, 'Login with {0}', requestedAccountLabel)),
|
|
242
249
|
run: () => requestedAccountLabel
|
|
243
250
|
}
|
|
244
251
|
],
|
|
@@ -251,20 +258,20 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
|
|
|
251
258
|
async loginPrompt(mcpLabel, providerLabel, recreatingSession) {
|
|
252
259
|
const message = recreatingSession
|
|
253
260
|
? ( localize(
|
|
254
|
-
|
|
261
|
+
2507,
|
|
255
262
|
"The MCP Server Definition '{0}' wants you to authenticate to {1}.",
|
|
256
263
|
mcpLabel,
|
|
257
264
|
providerLabel
|
|
258
265
|
))
|
|
259
266
|
: ( localize(
|
|
260
|
-
|
|
267
|
+
2508,
|
|
261
268
|
"The MCP Server Definition '{0}' wants to authenticate to {1}.",
|
|
262
269
|
mcpLabel,
|
|
263
270
|
providerLabel
|
|
264
271
|
));
|
|
265
272
|
const buttons = [
|
|
266
273
|
{
|
|
267
|
-
label: ( localize(
|
|
274
|
+
label: ( localize(2509, "&&Allow")),
|
|
268
275
|
run() {
|
|
269
276
|
return true;
|
|
270
277
|
},
|
|
@@ -295,8 +302,9 @@ MainThreadMcp = __decorate([
|
|
|
295
302
|
( __param(4, IAuthenticationMcpService)),
|
|
296
303
|
( __param(5, IAuthenticationMcpAccessService)),
|
|
297
304
|
( __param(6, IAuthenticationMcpUsageService)),
|
|
298
|
-
( __param(7,
|
|
299
|
-
( __param(8,
|
|
305
|
+
( __param(7, IDynamicAuthenticationProviderStorageService)),
|
|
306
|
+
( __param(8, IExtensionService)),
|
|
307
|
+
( __param(9, IContextKeyService))
|
|
300
308
|
], MainThreadMcp);
|
|
301
309
|
class ExtHostMcpServerLaunch extends Disposable {
|
|
302
310
|
pushLog(level, message) {
|
|
@@ -60,13 +60,13 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
60
60
|
sourceIsUrgent = MainThreadMessageService_1.URGENT_NOTIFICATION_SOURCES.includes(source.id);
|
|
61
61
|
}
|
|
62
62
|
if (!source) {
|
|
63
|
-
source = ( localize(
|
|
63
|
+
source = ( localize(2510, "Extension"));
|
|
64
64
|
}
|
|
65
65
|
const secondaryActions = [];
|
|
66
66
|
if (options.source) {
|
|
67
67
|
secondaryActions.push(toAction({
|
|
68
68
|
id: options.source.identifier.value,
|
|
69
|
-
label: ( localize(
|
|
69
|
+
label: ( localize(2511, "Manage Extension")),
|
|
70
70
|
run: () => {
|
|
71
71
|
return this._commandService.executeCommand('_extensions.manage', options.source.identifier.value);
|
|
72
72
|
}
|
|
@@ -103,13 +103,13 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
103
103
|
if (!cancelButton) {
|
|
104
104
|
if (buttons.length > 0) {
|
|
105
105
|
cancelButton = {
|
|
106
|
-
label: ( localize(
|
|
106
|
+
label: ( localize(2512, "Cancel")),
|
|
107
107
|
run: () => undefined
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
else {
|
|
111
111
|
cancelButton = {
|
|
112
|
-
label: ( localize(
|
|
112
|
+
label: ( localize(2513, "&&OK")),
|
|
113
113
|
run: () => undefined
|
|
114
114
|
};
|
|
115
115
|
}
|
|
@@ -11,7 +11,7 @@ import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platfor
|
|
|
11
11
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
12
12
|
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
13
13
|
import { INotebookCellStatusBarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService.service';
|
|
14
|
-
import { SimpleNotebookProviderInfo } from '@codingame/monaco-vscode-
|
|
14
|
+
import { SimpleNotebookProviderInfo } from '@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
15
15
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
16
16
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
17
17
|
import { SerializableObjectWithBuffers } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier';
|
|
@@ -183,10 +183,8 @@ CommandsRegistry.registerCommand('_executeDataToNotebook', async (accessor, ...a
|
|
|
183
183
|
const dto = await info.serializer.dataToNotebook(bytes);
|
|
184
184
|
return ( new SerializableObjectWithBuffers(NotebookDto.toNotebookDataDto(dto)));
|
|
185
185
|
});
|
|
186
|
-
CommandsRegistry.registerCommand('_executeNotebookToData', async (accessor,
|
|
187
|
-
const [notebookType, dto] = args;
|
|
186
|
+
CommandsRegistry.registerCommand('_executeNotebookToData', async (accessor, notebookType, dto) => {
|
|
188
187
|
assertType(typeof notebookType === 'string', 'string');
|
|
189
|
-
assertType(typeof dto === 'object');
|
|
190
188
|
const notebookService = accessor.get(INotebookService);
|
|
191
189
|
const info = await notebookService.withNotebookDataProvider(notebookType);
|
|
192
190
|
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
@@ -197,7 +195,8 @@ CommandsRegistry.registerCommand('_executeNotebookToData', async (accessor, ...a
|
|
|
197
195
|
return bytes;
|
|
198
196
|
});
|
|
199
197
|
function isFileOperationError(error) {
|
|
200
|
-
|
|
198
|
+
const candidate = error;
|
|
199
|
+
return typeof candidate?.fileOperationResult === 'number' && typeof candidate?.message === 'string';
|
|
201
200
|
}
|
|
202
201
|
|
|
203
202
|
export { MainThreadNotebooks };
|
|
@@ -8,8 +8,8 @@ import { MainThreadNotebookDocuments } from './mainThreadNotebookDocuments.js';
|
|
|
8
8
|
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
9
9
|
import { MainThreadNotebookEditors } from './mainThreadNotebookEditors.js';
|
|
10
10
|
import { extHostCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
11
|
-
import { editorGroupToColumn } from '@codingame/monaco-vscode-
|
|
12
|
-
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-
|
|
11
|
+
import { editorGroupToColumn } from '@codingame/monaco-vscode-3b5a5cd1-d4ff-500a-b609-57e0cd4afa0a-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
|
|
12
|
+
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
13
13
|
import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
|
|
14
14
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
15
15
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
2
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
-
import { INotebookEditor } from "@codingame/monaco-vscode-
|
|
3
|
+
import { INotebookEditor } from "@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
4
4
|
import { INotebookEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service";
|
|
5
|
-
import { ICellRange } from "@codingame/monaco-vscode-
|
|
5
|
+
import { ICellRange } from "@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/common/notebookRange";
|
|
6
6
|
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
7
7
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
8
8
|
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
@@ -5,9 +5,9 @@ import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objec
|
|
|
5
5
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
6
6
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
7
|
import { EditorActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor';
|
|
8
|
-
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-
|
|
8
|
+
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
9
9
|
import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
|
|
10
|
-
import { editorGroupToColumn, columnToEditorGroup } from '@codingame/monaco-vscode-
|
|
10
|
+
import { editorGroupToColumn, columnToEditorGroup } from '@codingame/monaco-vscode-3b5a5cd1-d4ff-500a-b609-57e0cd4afa0a-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
|
|
11
11
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
12
12
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
13
13
|
import { ExtHostContext, NotebookEditorRevealType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
@@ -26,7 +26,7 @@ export declare class MainThreadNotebookKernels implements MainThreadNotebookKern
|
|
|
26
26
|
dispose(): void;
|
|
27
27
|
private _onEditorAdd;
|
|
28
28
|
private _onEditorRemove;
|
|
29
|
-
$postMessage(handle: number, editorId: string | undefined, message:
|
|
29
|
+
$postMessage(handle: number, editorId: string | undefined, message: unknown): Promise<boolean>;
|
|
30
30
|
private variableRequestIndex;
|
|
31
31
|
private variableRequestMap;
|
|
32
32
|
$receiveVariable(requestId: string, variable: VariablesResult): void;
|
|
@@ -14,7 +14,7 @@ import { INotebookExecutionStateService } from '@codingame/monaco-vscode-api/vsc
|
|
|
14
14
|
import { INotebookKernelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
15
15
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
16
16
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
17
|
-
import {
|
|
17
|
+
import { AsyncIterableProducer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
18
18
|
|
|
19
19
|
class MainThreadKernel {
|
|
20
20
|
get preloadUris() {
|
|
@@ -176,9 +176,9 @@ let MainThreadNotebookKernels = class MainThreadNotebookKernels {
|
|
|
176
176
|
return didSend;
|
|
177
177
|
}
|
|
178
178
|
$receiveVariable(requestId, variable) {
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
|
|
179
|
+
const emitter = this.variableRequestMap.get(requestId);
|
|
180
|
+
if (emitter) {
|
|
181
|
+
emitter.emitOne(variable);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
async $addKernel(handle, data) {
|
|
@@ -192,19 +192,15 @@ let MainThreadNotebookKernels = class MainThreadNotebookKernels {
|
|
|
192
192
|
}
|
|
193
193
|
provideVariables(notebookUri, parentId, kind, start, token) {
|
|
194
194
|
const requestId = `${handle}variables${that.variableRequestIndex++}`;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
})
|
|
204
|
-
source.reject(err);
|
|
205
|
-
that.variableRequestMap.delete(requestId);
|
|
206
|
-
});
|
|
207
|
-
return source.asyncIterable;
|
|
195
|
+
return ( new AsyncIterableProducer(async (emitter) => {
|
|
196
|
+
that.variableRequestMap.set(requestId, emitter);
|
|
197
|
+
try {
|
|
198
|
+
await that._proxy.$provideVariables(handle, requestId, notebookUri, parentId, kind, start, token);
|
|
199
|
+
}
|
|
200
|
+
finally {
|
|
201
|
+
that.variableRequestMap.delete(requestId);
|
|
202
|
+
}
|
|
203
|
+
}));
|
|
208
204
|
}
|
|
209
205
|
})(data, this._languageService);
|
|
210
206
|
const disposables = this._disposables.add(( new DisposableStore()));
|
|
@@ -6,7 +6,7 @@ import { extHostCustomer } from '../../services/extensions/common/extHostCustome
|
|
|
6
6
|
import { ExtHostContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
7
7
|
import { raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
8
8
|
import { IWorkingCopyFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
|
|
9
|
-
import { NotebookFileWorkingCopyModel } from '@codingame/monaco-vscode-
|
|
9
|
+
import { NotebookFileWorkingCopyModel } from '@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
|
|
10
10
|
|
|
11
11
|
class ExtHostNotebookDocumentSaveParticipant {
|
|
12
12
|
constructor(extHostContext) {
|
|
@@ -18,7 +18,7 @@ class ExtHostNotebookDocumentSaveParticipant {
|
|
|
18
18
|
}
|
|
19
19
|
let _warningTimeout;
|
|
20
20
|
const p = ( new Promise((resolve, reject) => {
|
|
21
|
-
_warningTimeout = setTimeout(() => reject(( new Error(( localize(
|
|
21
|
+
_warningTimeout = setTimeout(() => reject(( new Error(( localize(2514, "Aborted onWillSaveNotebookDocument-event after 1750ms"))))), 1750);
|
|
22
22
|
this._proxy.$participateInSave(workingCopy.resource, context.reason, token).then(_ => {
|
|
23
23
|
clearTimeout(_warningTimeout);
|
|
24
24
|
return undefined;
|
|
@@ -69,11 +69,11 @@ let MainThreadOutputService = class MainThreadOutputService extends Disposable {
|
|
|
69
69
|
}
|
|
70
70
|
_showChannelQuietly(channel) {
|
|
71
71
|
const statusProperties = {
|
|
72
|
-
name: ( localize(
|
|
72
|
+
name: ( localize(2515, "Show Output")),
|
|
73
73
|
text: '$(output)',
|
|
74
|
-
ariaLabel: ( localize(
|
|
74
|
+
ariaLabel: ( localize(2516, "Show {0} Output Channel", channel.label)),
|
|
75
75
|
command: `workbench.action.output.show.${channel.id}`,
|
|
76
|
-
tooltip: ( localize(
|
|
76
|
+
tooltip: ( localize(2517, "Show {0} Output Channel", channel.label)),
|
|
77
77
|
kind: 'prominent'
|
|
78
78
|
};
|
|
79
79
|
if (!this._outputStatusItem.value) {
|
|
@@ -37,7 +37,7 @@ let MainThreadProgress = class MainThreadProgress {
|
|
|
37
37
|
location: ProgressLocation.Notification,
|
|
38
38
|
secondaryActions: [toAction({
|
|
39
39
|
id: extensionId,
|
|
40
|
-
label: ( localize(
|
|
40
|
+
label: ( localize(2518, "Manage Extension")),
|
|
41
41
|
run: () => this._commandService.executeCommand('_extensions.manage', extensionId)
|
|
42
42
|
})]
|
|
43
43
|
};
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
3
|
+
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
4
|
+
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
1
5
|
import { IPickOptions } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
2
6
|
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
3
|
-
import {
|
|
7
|
+
import { ICustomEditorLabelService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/customEditorLabelService.service";
|
|
4
8
|
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
5
|
-
import {
|
|
9
|
+
import { IInputBoxOptions, MainThreadQuickOpenShape, TransferQuickInput, TransferQuickPickItem, TransferQuickPickItemOrSeparator } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
6
10
|
export declare class MainThreadQuickOpen implements MainThreadQuickOpenShape {
|
|
11
|
+
private readonly labelService;
|
|
12
|
+
private readonly customEditorLabelService;
|
|
13
|
+
private readonly modelService;
|
|
14
|
+
private readonly languageService;
|
|
7
15
|
private readonly _proxy;
|
|
8
16
|
private readonly _quickInputService;
|
|
9
17
|
private readonly _items;
|
|
10
|
-
constructor(extHostContext: IExtHostContext, quickInputService: IQuickInputService);
|
|
18
|
+
constructor(extHostContext: IExtHostContext, quickInputService: IQuickInputService, labelService: ILabelService, customEditorLabelService: ICustomEditorLabelService, modelService: IModelService, languageService: ILanguageService);
|
|
11
19
|
dispose(): void;
|
|
12
20
|
$show(instance: number, options: IPickOptions<TransferQuickPickItem>, token: CancellationToken): Promise<number | number[] | undefined>;
|
|
13
21
|
$setItems(instance: number, items: TransferQuickPickItemOrSeparator[]): Promise<void>;
|
|
@@ -16,4 +24,17 @@ export declare class MainThreadQuickOpen implements MainThreadQuickOpenShape {
|
|
|
16
24
|
private sessions;
|
|
17
25
|
$createOrUpdate(params: TransferQuickInput): Promise<void>;
|
|
18
26
|
$dispose(sessionId: number): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Derives icon, label and description for Quick Pick items that represent a resource URI.
|
|
29
|
+
*/
|
|
30
|
+
private expandItemProps;
|
|
31
|
+
/**
|
|
32
|
+
* Converts IconPath DTO into iconPath/iconClass properties.
|
|
33
|
+
*/
|
|
34
|
+
private expandIconPath;
|
|
35
|
+
/**
|
|
36
|
+
* Updates the toggles for a given quick input session by creating new {@link Toggle}-s
|
|
37
|
+
* from buttons, updating existing toggles props and removing old ones.
|
|
38
|
+
*/
|
|
39
|
+
private updateToggles;
|
|
19
40
|
}
|