@codingame/monaco-vscode-extensions-service-override 8.0.3 → 9.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/assets/{webWorkerExtensionHostIframe.html → webWorkerExtensionHostIframe.esm.html} +51 -15
- package/extensions.js +15 -41
- package/package.json +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +28 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +42 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +17 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +5 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +1 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +19 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +19 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +23 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +3 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +10 -2
- 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/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +8 -7
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +9 -6
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +42 -28
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +6 -7
- 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.js +3 -0
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +11 -5
|
@@ -61,6 +61,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
61
61
|
this._agents = this._register(( new DisposableMap()));
|
|
62
62
|
this._agentCompletionProviders = this._register(( new DisposableMap()));
|
|
63
63
|
this._agentIdsToCompletionProviders = this._register(( new DisposableMap()));
|
|
64
|
+
this._chatParticipantDetectionProviders = this._register(( new DisposableMap()));
|
|
64
65
|
this._pendingProgress = ( new Map());
|
|
65
66
|
this._responsePartHandlePool = 0;
|
|
66
67
|
this._activeTasks = ( new Map());
|
|
@@ -73,7 +74,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
73
74
|
for (const [handle, agent] of this._agents) {
|
|
74
75
|
if (agent.id === e.agentId) {
|
|
75
76
|
if (e.action.kind === 'vote') {
|
|
76
|
-
this._proxy.$acceptFeedback(handle, e.result ?? {}, e.action
|
|
77
|
+
this._proxy.$acceptFeedback(handle, e.result ?? {}, e.action);
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
80
|
this._proxy.$acceptAction(handle, e.result || {}, e);
|
|
@@ -126,6 +127,9 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
126
127
|
provideWelcomeMessage: (location, token) => {
|
|
127
128
|
return this._proxy.$provideWelcomeMessage(handle, location, token);
|
|
128
129
|
},
|
|
130
|
+
provideChatTitle: (history, token) => {
|
|
131
|
+
return this._proxy.$provideChatTitle(handle, history, token);
|
|
132
|
+
},
|
|
129
133
|
provideSampleQuestions: (location, token) => {
|
|
130
134
|
return this._proxy.$provideSampleQuestions(handle, location, token);
|
|
131
135
|
}
|
|
@@ -135,7 +139,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
135
139
|
const extensionDescription = this._extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension));
|
|
136
140
|
disposable = this._chatAgentService.registerDynamicAgent({
|
|
137
141
|
id,
|
|
138
|
-
name: dynamicProps.name
|
|
142
|
+
name: dynamicProps.name,
|
|
139
143
|
description: dynamicProps.description,
|
|
140
144
|
extensionId: extension,
|
|
141
145
|
extensionDisplayName: extensionDescription?.displayName ?? extension.value,
|
|
@@ -144,6 +148,7 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
144
148
|
fullName: dynamicProps.fullName,
|
|
145
149
|
metadata: revive(metadata),
|
|
146
150
|
slashCommands: [],
|
|
151
|
+
disambiguation: [],
|
|
147
152
|
locations: [ChatAgentLocation.Panel]
|
|
148
153
|
}, impl);
|
|
149
154
|
}
|
|
@@ -256,6 +261,16 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
256
261
|
this._agentCompletionProviders.deleteAndDispose(handle);
|
|
257
262
|
this._agentIdsToCompletionProviders.deleteAndDispose(id);
|
|
258
263
|
}
|
|
264
|
+
$registerChatParticipantDetectionProvider(handle) {
|
|
265
|
+
this._chatParticipantDetectionProviders.set(handle, this._chatAgentService.registerChatParticipantDetectionProvider(handle, {
|
|
266
|
+
provideParticipantDetection: async (request, history, options, token) => {
|
|
267
|
+
return await this._proxy.$detectChatParticipant(handle, request, { history }, options, token);
|
|
268
|
+
}
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
$unregisterChatParticipantDetectionProvider(handle) {
|
|
272
|
+
this._chatParticipantDetectionProviders.deleteAndDispose(handle);
|
|
273
|
+
}
|
|
259
274
|
};
|
|
260
275
|
MainThreadChatAgents2 = __decorate([
|
|
261
276
|
extHostNamedCustomer(MainContext.MainThreadChatAgents2),
|
|
@@ -156,7 +156,7 @@ class MainThreadCommentThread {
|
|
|
156
156
|
this._contextValue = changes.contextValue === null ? undefined : changes.contextValue;
|
|
157
157
|
}
|
|
158
158
|
if (modified('comments')) {
|
|
159
|
-
this.
|
|
159
|
+
this.comments = changes.comments;
|
|
160
160
|
}
|
|
161
161
|
if (modified('collapseState')) {
|
|
162
162
|
this.initialCollapsibleState = changes.collapseState;
|
|
@@ -174,6 +174,9 @@ class MainThreadCommentThread {
|
|
|
174
174
|
this._isTemplate = changes.isTemplate;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
+
hasComments() {
|
|
178
|
+
return !!this.comments && this.comments.length > 0;
|
|
179
|
+
}
|
|
177
180
|
dispose() {
|
|
178
181
|
this._isDisposed = true;
|
|
179
182
|
this._onDidChangeCollapsibleState.dispose();
|
|
@@ -416,7 +419,7 @@ class MainThreadCommentController {
|
|
|
416
419
|
};
|
|
417
420
|
}
|
|
418
421
|
}
|
|
419
|
-
const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localize(
|
|
422
|
+
const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localize(4941, 'View icon of the comments view.')));
|
|
420
423
|
let MainThreadComments = class MainThreadComments extends Disposable {
|
|
421
424
|
constructor(extHostContext, _commentService, _viewsService, _viewDescriptorService, _uriIdentityService, _editorService) {
|
|
422
425
|
super();
|
|
@@ -305,7 +305,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
|
|
|
305
305
|
return true;
|
|
306
306
|
}
|
|
307
307
|
return false;
|
|
308
|
-
})(), ( localize(
|
|
308
|
+
})(), ( localize(9875, "Custom editor '{0}' could not be saved.", this.name)));
|
|
309
309
|
}));
|
|
310
310
|
}
|
|
311
311
|
if (startDirty) {
|
|
@@ -372,7 +372,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
|
|
|
372
372
|
this._undoService.pushElement({
|
|
373
373
|
type: UndoRedoElementType.Resource,
|
|
374
374
|
resource: this._editorResource,
|
|
375
|
-
label: label ?? ( localize(
|
|
375
|
+
label: label ?? ( localize(9876, "Edit")),
|
|
376
376
|
code: 'undoredo.customEditorEdit',
|
|
377
377
|
undo: () => this.undo(),
|
|
378
378
|
redo: () => this.redo(),
|
|
@@ -13,7 +13,7 @@ class ExtHostEditSessionIdentityCreateParticipant {
|
|
|
13
13
|
}
|
|
14
14
|
async participate(workspaceFolder, token) {
|
|
15
15
|
const p = ( (new Promise((resolve, reject) => {
|
|
16
|
-
setTimeout(() => reject(( (new Error(( localize(
|
|
16
|
+
setTimeout(() => reject(( (new Error(( localize(4933, "Aborted onWillCreateEditSessionIdentity-event after 10000ms")))))), this.timeout);
|
|
17
17
|
this._proxy.$onWillCreateEditSessionIdentity(workspaceFolder.uri, token, this.timeout).then(resolve, reject);
|
|
18
18
|
})));
|
|
19
19
|
return raceCancellationError(p, token);
|
|
@@ -90,13 +90,13 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
90
90
|
this._notificationService.notify({
|
|
91
91
|
severity: Severity$1.Error,
|
|
92
92
|
message: ( localize(
|
|
93
|
-
|
|
93
|
+
4898,
|
|
94
94
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",
|
|
95
95
|
extName,
|
|
96
96
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
97
97
|
)),
|
|
98
98
|
actions: {
|
|
99
|
-
primary: [( (new Action('reload', ( localize(
|
|
99
|
+
primary: [( (new Action('reload', ( localize(4899, "Reload Window")), '', true, () => this._hostService.reload())))]
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -106,7 +106,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
106
106
|
this._notificationService.notify({
|
|
107
107
|
severity: Severity$1.Error,
|
|
108
108
|
message: ( localize(
|
|
109
|
-
|
|
109
|
+
4900,
|
|
110
110
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",
|
|
111
111
|
extName,
|
|
112
112
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -117,13 +117,13 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
117
117
|
this._notificationService.notify({
|
|
118
118
|
severity: Severity$1.Error,
|
|
119
119
|
message: ( localize(
|
|
120
|
-
|
|
120
|
+
4901,
|
|
121
121
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",
|
|
122
122
|
extName,
|
|
123
123
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
124
124
|
)),
|
|
125
125
|
actions: {
|
|
126
|
-
primary: [( (new Action('manageWorkspaceTrust', ( localize(
|
|
126
|
+
primary: [( (new Action('manageWorkspaceTrust', ( localize(4902, "Manage Workspace Trust")), '', true, () => this._commandService.executeCommand('workbench.trust.manage'))))]
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
}
|
|
@@ -131,13 +131,13 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
131
131
|
this._notificationService.notify({
|
|
132
132
|
severity: Severity$1.Error,
|
|
133
133
|
message: ( localize(
|
|
134
|
-
|
|
134
|
+
4903,
|
|
135
135
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",
|
|
136
136
|
extName,
|
|
137
137
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
138
138
|
)),
|
|
139
139
|
actions: {
|
|
140
|
-
primary: [( (new Action('enable', ( localize(
|
|
140
|
+
primary: [( (new Action('enable', ( localize(4904, "Enable and Reload")), '', true, () => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === EnablementState.DisabledGlobally ? EnablementState.EnabledGlobally : EnablementState.EnabledWorkspace)
|
|
141
141
|
.then(() => this._hostService.reload(), e => this._notificationService.error(e)))))]
|
|
142
142
|
}
|
|
143
143
|
});
|
|
@@ -146,7 +146,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
146
146
|
this._notificationService.notify({
|
|
147
147
|
severity: Severity$1.Error,
|
|
148
148
|
message: ( localize(
|
|
149
|
-
|
|
149
|
+
4905,
|
|
150
150
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",
|
|
151
151
|
extName,
|
|
152
152
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -167,21 +167,21 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
167
167
|
this._notificationService.notify({
|
|
168
168
|
severity: Severity$1.Error,
|
|
169
169
|
message: ( localize(
|
|
170
|
-
|
|
170
|
+
4906,
|
|
171
171
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",
|
|
172
172
|
extName,
|
|
173
173
|
dependencyExtension.displayName,
|
|
174
174
|
dependencyExtension.publisherDisplayName
|
|
175
175
|
)),
|
|
176
176
|
actions: {
|
|
177
|
-
primary: [( (new Action('install', ( localize(
|
|
177
|
+
primary: [( (new Action('install', ( localize(4907, "Install and Reload")), '', true, () => this._extensionsWorkbenchService.install(dependencyExtension)
|
|
178
178
|
.then(() => this._hostService.reload(), e => this._notificationService.error(e)))))]
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
else {
|
|
183
183
|
this._notificationService.error(( localize(
|
|
184
|
-
|
|
184
|
+
4908,
|
|
185
185
|
"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",
|
|
186
186
|
extName,
|
|
187
187
|
missingDependency
|
|
@@ -81,28 +81,28 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
81
81
|
if (data.extensionNames.length === 1) {
|
|
82
82
|
if (operation === FileOperation.CREATE) {
|
|
83
83
|
message = ( localize(
|
|
84
|
-
|
|
84
|
+
4909,
|
|
85
85
|
"Extension '{0}' wants to make refactoring changes with this file creation",
|
|
86
86
|
data.extensionNames[0]
|
|
87
87
|
));
|
|
88
88
|
}
|
|
89
89
|
else if (operation === FileOperation.COPY) {
|
|
90
90
|
message = ( localize(
|
|
91
|
-
|
|
91
|
+
4910,
|
|
92
92
|
"Extension '{0}' wants to make refactoring changes with this file copy",
|
|
93
93
|
data.extensionNames[0]
|
|
94
94
|
));
|
|
95
95
|
}
|
|
96
96
|
else if (operation === FileOperation.MOVE) {
|
|
97
97
|
message = ( localize(
|
|
98
|
-
|
|
98
|
+
4911,
|
|
99
99
|
"Extension '{0}' wants to make refactoring changes with this file move",
|
|
100
100
|
data.extensionNames[0]
|
|
101
101
|
));
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
104
|
message = ( localize(
|
|
105
|
-
|
|
105
|
+
4912,
|
|
106
106
|
"Extension '{0}' wants to make refactoring changes with this file deletion",
|
|
107
107
|
data.extensionNames[0]
|
|
108
108
|
));
|
|
@@ -111,28 +111,28 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
111
111
|
else {
|
|
112
112
|
if (operation === FileOperation.CREATE) {
|
|
113
113
|
message = ( localize(
|
|
114
|
-
|
|
114
|
+
4913,
|
|
115
115
|
"{0} extensions want to make refactoring changes with this file creation",
|
|
116
116
|
data.extensionNames.length
|
|
117
117
|
));
|
|
118
118
|
}
|
|
119
119
|
else if (operation === FileOperation.COPY) {
|
|
120
120
|
message = ( localize(
|
|
121
|
-
|
|
121
|
+
4914,
|
|
122
122
|
"{0} extensions want to make refactoring changes with this file copy",
|
|
123
123
|
data.extensionNames.length
|
|
124
124
|
));
|
|
125
125
|
}
|
|
126
126
|
else if (operation === FileOperation.MOVE) {
|
|
127
127
|
message = ( localize(
|
|
128
|
-
|
|
128
|
+
4915,
|
|
129
129
|
"{0} extensions want to make refactoring changes with this file move",
|
|
130
130
|
data.extensionNames.length
|
|
131
131
|
));
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
134
134
|
message = ( localize(
|
|
135
|
-
|
|
135
|
+
4916,
|
|
136
136
|
"{0} extensions want to make refactoring changes with this file deletion",
|
|
137
137
|
data.extensionNames.length
|
|
138
138
|
));
|
|
@@ -142,8 +142,8 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
142
142
|
const { confirmed } = await dialogService.confirm({
|
|
143
143
|
type: Severity$1.Info,
|
|
144
144
|
message,
|
|
145
|
-
primaryButton: ( localize(
|
|
146
|
-
cancelButton: ( localize(
|
|
145
|
+
primaryButton: ( localize(4917, "Show &&Preview")),
|
|
146
|
+
cancelButton: ( localize(4918, "Skip Changes"))
|
|
147
147
|
});
|
|
148
148
|
showPreview = true;
|
|
149
149
|
if (!confirmed) {
|
|
@@ -162,19 +162,19 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
162
162
|
message,
|
|
163
163
|
buttons: [
|
|
164
164
|
{
|
|
165
|
-
label: ( localize(
|
|
165
|
+
label: ( localize(4919, "&&OK")),
|
|
166
166
|
run: () => Choice.OK
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
|
-
label: ( localize(
|
|
169
|
+
label: ( localize(4917, "Show &&Preview")),
|
|
170
170
|
run: () => Choice.Preview
|
|
171
171
|
}
|
|
172
172
|
],
|
|
173
173
|
cancelButton: {
|
|
174
|
-
label: ( localize(
|
|
174
|
+
label: ( localize(4918, "Skip Changes")),
|
|
175
175
|
run: () => Choice.Cancel
|
|
176
176
|
},
|
|
177
|
-
checkbox: { label: ( localize(
|
|
177
|
+
checkbox: { label: ( localize(4920, "Do not ask me again")) }
|
|
178
178
|
});
|
|
179
179
|
if (result === Choice.Cancel) {
|
|
180
180
|
return;
|
|
@@ -191,15 +191,15 @@ let MainThreadFileSystemEventService = class MainThreadFileSystemEventService {
|
|
|
191
191
|
_progressLabel(operation) {
|
|
192
192
|
switch (operation) {
|
|
193
193
|
case FileOperation.CREATE:
|
|
194
|
-
return ( localize(
|
|
194
|
+
return ( localize(4921, "Running 'File Create' participants..."));
|
|
195
195
|
case FileOperation.MOVE:
|
|
196
|
-
return ( localize(
|
|
196
|
+
return ( localize(4922, "Running 'File Rename' participants..."));
|
|
197
197
|
case FileOperation.COPY:
|
|
198
|
-
return ( localize(
|
|
198
|
+
return ( localize(4923, "Running 'File Copy' participants..."));
|
|
199
199
|
case FileOperation.DELETE:
|
|
200
|
-
return ( localize(
|
|
200
|
+
return ( localize(4924, "Running 'File Delete' participants..."));
|
|
201
201
|
case FileOperation.WRITE:
|
|
202
|
-
return ( localize(
|
|
202
|
+
return ( localize(4925, "Running 'File Write' participants..."));
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
});
|
|
@@ -301,7 +301,7 @@ registerAction2(class ResetMemento extends Action2 {
|
|
|
301
301
|
super({
|
|
302
302
|
id: 'files.participants.resetChoice',
|
|
303
303
|
title: {
|
|
304
|
-
value: ( localize(
|
|
304
|
+
value: ( localize(4926, "Reset choice for 'File operation needs preview'")),
|
|
305
305
|
original: `Reset choice for 'File operation needs preview'`
|
|
306
306
|
},
|
|
307
307
|
f1: true
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { isFalsyOrEmpty } from 'vscode/vscode/vs/base/common/arrays';
|
|
3
2
|
import { VSDataTransfer, createStringDataTransferItem } from 'vscode/vscode/vs/base/common/dataTransfer';
|
|
4
3
|
import { CancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
5
4
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
@@ -253,7 +252,7 @@ let MainThreadLanguageFeatures = MainThreadLanguageFeatures_1 = class MainThread
|
|
|
253
252
|
selector: selector,
|
|
254
253
|
provideMultiDocumentHighlights: (model, position, otherModels, token) => {
|
|
255
254
|
return this._proxy.$provideMultiDocumentHighlights(handle, model.uri, position, ( otherModels.map(model => model.uri)), token).then(dto => {
|
|
256
|
-
if (
|
|
255
|
+
if (dto === undefined || dto === null) {
|
|
257
256
|
return undefined;
|
|
258
257
|
}
|
|
259
258
|
const result = ( new ResourceMap());
|
|
@@ -9,19 +9,33 @@ let MainThreadLanguageModelTools = class MainThreadLanguageModelTools extends Di
|
|
|
9
9
|
super();
|
|
10
10
|
this._languageModelToolsService = _languageModelToolsService;
|
|
11
11
|
this._tools = this._register(( new DisposableMap()));
|
|
12
|
+
this._countTokenCallbacks = ( new Map());
|
|
12
13
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostLanguageModelTools));
|
|
13
|
-
this._register(this._languageModelToolsService.onDidChangeTools(e => this._proxy.$
|
|
14
|
+
this._register(this._languageModelToolsService.onDidChangeTools(e => this._proxy.$onDidChangeTools([...this._languageModelToolsService.getTools()])));
|
|
14
15
|
}
|
|
15
16
|
async $getTools() {
|
|
16
17
|
return Array.from(this._languageModelToolsService.getTools());
|
|
17
18
|
}
|
|
18
|
-
$invokeTool(
|
|
19
|
-
return this._languageModelToolsService.invokeTool(
|
|
19
|
+
$invokeTool(dto, token) {
|
|
20
|
+
return this._languageModelToolsService.invokeTool(dto, (input, token) => this._proxy.$countTokensForInvocation(dto.callId, input, token), token);
|
|
21
|
+
}
|
|
22
|
+
$countTokensForInvocation(callId, input, token) {
|
|
23
|
+
const fn = this._countTokenCallbacks.get(callId);
|
|
24
|
+
if (!fn) {
|
|
25
|
+
throw ( new Error(`Tool invocation call ${callId} not found`));
|
|
26
|
+
}
|
|
27
|
+
return fn(input, token);
|
|
20
28
|
}
|
|
21
29
|
$registerTool(name) {
|
|
22
30
|
const disposable = this._languageModelToolsService.registerToolImplementation(name, {
|
|
23
|
-
invoke: async (
|
|
24
|
-
|
|
31
|
+
invoke: async (dto, countTokens, token) => {
|
|
32
|
+
try {
|
|
33
|
+
this._countTokenCallbacks.set(dto.callId, countTokens);
|
|
34
|
+
return await this._proxy.$invokeTool(dto, token);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
this._countTokenCallbacks.delete(dto.callId);
|
|
38
|
+
}
|
|
25
39
|
},
|
|
26
40
|
});
|
|
27
41
|
this._tools.set(name, disposable);
|
|
@@ -129,7 +129,7 @@ let MainThreadLanguageModels = class MainThreadLanguageModels {
|
|
|
129
129
|
if (this._authenticationService.getProviderIds().includes(authProviderId)) {
|
|
130
130
|
return Disposable.None;
|
|
131
131
|
}
|
|
132
|
-
const accountLabel = auth.accountLabel ?? ( localize(
|
|
132
|
+
const accountLabel = auth.accountLabel ?? ( localize(4896, 'Language Models'));
|
|
133
133
|
const disposables = ( (new DisposableStore()));
|
|
134
134
|
this._authenticationService.registerAuthenticationProvider(authProviderId, ( (new LanguageModelAccessAuthProvider(authProviderId, auth.providerLabel, accountLabel))));
|
|
135
135
|
disposables.add(toDisposable(() => {
|
|
@@ -51,13 +51,13 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
if (!source) {
|
|
54
|
-
source = ( localize(
|
|
54
|
+
source = ( localize(4927, "Extension"));
|
|
55
55
|
}
|
|
56
56
|
const secondaryActions = [];
|
|
57
57
|
if (options.source) {
|
|
58
58
|
secondaryActions.push(toAction({
|
|
59
59
|
id: options.source.identifier.value,
|
|
60
|
-
label: ( localize(
|
|
60
|
+
label: ( localize(4928, "Manage Extension")),
|
|
61
61
|
run: () => {
|
|
62
62
|
return this._commandService.executeCommand('_extensions.manage', options.source.identifier.value);
|
|
63
63
|
}
|
|
@@ -93,13 +93,13 @@ let MainThreadMessageService = class MainThreadMessageService {
|
|
|
93
93
|
if (!cancelButton) {
|
|
94
94
|
if (buttons.length > 0) {
|
|
95
95
|
cancelButton = {
|
|
96
|
-
label: ( localize(
|
|
96
|
+
label: ( localize(4929, "Cancel")),
|
|
97
97
|
run: () => undefined
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
101
|
cancelButton = {
|
|
102
|
-
label: ( localize(
|
|
102
|
+
label: ( localize(4930, "&&OK")),
|
|
103
103
|
run: () => undefined
|
|
104
104
|
};
|
|
105
105
|
}
|
|
@@ -90,20 +90,31 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
async $tryCreateNotebook(options) {
|
|
93
|
-
const ref = await this._notebookEditorModelResolverService.resolve({ untitledResource: undefined }, options.viewType);
|
|
94
|
-
ref.object.notebook.onWillDispose(() => {
|
|
95
|
-
ref.dispose();
|
|
96
|
-
});
|
|
97
|
-
this._proxy.$acceptDirtyStateChanged(ref.object.resource, true);
|
|
98
93
|
if (options.content) {
|
|
99
|
-
const
|
|
100
|
-
ref.object.notebook.
|
|
94
|
+
const ref = await this._notebookEditorModelResolverService.resolve({ untitledResource: undefined }, options.viewType);
|
|
95
|
+
ref.object.notebook.onWillDispose(() => {
|
|
96
|
+
ref.dispose();
|
|
97
|
+
});
|
|
98
|
+
this._proxy.$acceptDirtyStateChanged(ref.object.resource, true);
|
|
99
|
+
if (options.content) {
|
|
100
|
+
const data = NotebookDto.fromNotebookDataDto(options.content);
|
|
101
|
+
ref.object.notebook.reset(data.cells, data.metadata, ref.object.notebook.transientOptions);
|
|
102
|
+
}
|
|
103
|
+
return ref.object.notebook.uri;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const notebook = await this._notebookEditorModelResolverService.createUntitledNotebookTextModel(options.viewType);
|
|
107
|
+
return notebook.uri;
|
|
101
108
|
}
|
|
102
|
-
return ref.object.resource;
|
|
103
109
|
}
|
|
104
110
|
async $tryOpenNotebook(uriComponents) {
|
|
105
111
|
const uri = URI.revive(uriComponents);
|
|
106
112
|
const ref = await this._notebookEditorModelResolverService.resolve(uri, undefined);
|
|
113
|
+
if (uriComponents.scheme === 'untitled') {
|
|
114
|
+
ref.object.notebook.onWillDispose(() => {
|
|
115
|
+
ref.dispose();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
107
118
|
this._modelReferenceCollection.add(uri, ref);
|
|
108
119
|
return uri;
|
|
109
120
|
}
|
|
@@ -75,6 +75,7 @@ let MainThreadNotebookEditors = class MainThreadNotebookEditors {
|
|
|
75
75
|
preserveFocus: options.preserveFocus,
|
|
76
76
|
pinned: options.pinned,
|
|
77
77
|
activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
|
|
78
|
+
label: options.label,
|
|
78
79
|
override: viewType
|
|
79
80
|
};
|
|
80
81
|
const editorPane = await this._editorService.openEditor({ resource: URI.revive(resource), options: editorOptions }, columnToEditorGroup(this._editorGroupService, this._configurationService, options.position));
|
|
@@ -17,7 +17,7 @@ class ExtHostNotebookDocumentSaveParticipant {
|
|
|
17
17
|
}
|
|
18
18
|
let _warningTimeout;
|
|
19
19
|
const p = ( (new Promise((resolve, reject) => {
|
|
20
|
-
_warningTimeout = setTimeout(() => reject(( (new Error(( localize(
|
|
20
|
+
_warningTimeout = setTimeout(() => reject(( (new Error(( localize(4942, "Aborted onWillSaveNotebookDocument-event after 1750ms")))))), 1750);
|
|
21
21
|
this._proxy.$participateInSave(workingCopy.resource, context.reason, token).then(_ => {
|
|
22
22
|
clearTimeout(_warningTimeout);
|
|
23
23
|
return undefined;
|
|
@@ -31,7 +31,7 @@ let MainThreadProgress = class MainThreadProgress {
|
|
|
31
31
|
const notificationOptions = {
|
|
32
32
|
...options,
|
|
33
33
|
location: ProgressLocation.Notification,
|
|
34
|
-
secondaryActions: [( (new ManageExtensionAction(extensionId, ( localize(
|
|
34
|
+
secondaryActions: [( (new ManageExtensionAction(extensionId, ( localize(4931, "Manage Extension")), this._commandService)))]
|
|
35
35
|
};
|
|
36
36
|
options = notificationOptions;
|
|
37
37
|
}
|
|
@@ -3,6 +3,7 @@ import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/
|
|
|
3
3
|
import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
|
|
4
4
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
5
5
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
6
|
+
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
7
|
|
|
7
8
|
function reviveIconPathUris(iconPath) {
|
|
8
9
|
iconPath.dark = URI.revive(iconPath.dark);
|
|
@@ -18,6 +19,9 @@ let MainThreadQuickOpen = class MainThreadQuickOpen {
|
|
|
18
19
|
this._quickInputService = quickInputService;
|
|
19
20
|
}
|
|
20
21
|
dispose() {
|
|
22
|
+
for (const [_id, session] of this.sessions) {
|
|
23
|
+
session.store.dispose();
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
$show(instance, options, token) {
|
|
23
27
|
const contents = ( new Promise((resolve, reject) => {
|
|
@@ -84,34 +88,37 @@ let MainThreadQuickOpen = class MainThreadQuickOpen {
|
|
|
84
88
|
const sessionId = params.id;
|
|
85
89
|
let session = this.sessions.get(sessionId);
|
|
86
90
|
if (!session) {
|
|
91
|
+
const store = ( new DisposableStore());
|
|
87
92
|
const input = params.type === 'quickPick' ? this._quickInputService.createQuickPick() : this._quickInputService.createInputBox();
|
|
88
|
-
|
|
93
|
+
store.add(input);
|
|
94
|
+
store.add(input.onDidAccept(() => {
|
|
89
95
|
this._proxy.$onDidAccept(sessionId);
|
|
90
|
-
});
|
|
91
|
-
input.onDidTriggerButton(button => {
|
|
96
|
+
}));
|
|
97
|
+
store.add(input.onDidTriggerButton(button => {
|
|
92
98
|
this._proxy.$onDidTriggerButton(sessionId, button.handle);
|
|
93
|
-
});
|
|
94
|
-
input.onDidChangeValue(value => {
|
|
99
|
+
}));
|
|
100
|
+
store.add(input.onDidChangeValue(value => {
|
|
95
101
|
this._proxy.$onDidChangeValue(sessionId, value);
|
|
96
|
-
});
|
|
97
|
-
input.onDidHide(() => {
|
|
102
|
+
}));
|
|
103
|
+
store.add(input.onDidHide(() => {
|
|
98
104
|
this._proxy.$onDidHide(sessionId);
|
|
99
|
-
});
|
|
105
|
+
}));
|
|
100
106
|
if (params.type === 'quickPick') {
|
|
101
107
|
const quickpick = input;
|
|
102
|
-
quickpick.onDidChangeActive(items => {
|
|
108
|
+
store.add(quickpick.onDidChangeActive(items => {
|
|
103
109
|
this._proxy.$onDidChangeActive(sessionId, ( items.map(item => item.handle)));
|
|
104
|
-
});
|
|
105
|
-
quickpick.onDidChangeSelection(items => {
|
|
110
|
+
}));
|
|
111
|
+
store.add(quickpick.onDidChangeSelection(items => {
|
|
106
112
|
this._proxy.$onDidChangeSelection(sessionId, ( items.map(item => item.handle)));
|
|
107
|
-
});
|
|
108
|
-
quickpick.onDidTriggerItemButton((e) => {
|
|
113
|
+
}));
|
|
114
|
+
store.add(quickpick.onDidTriggerItemButton((e) => {
|
|
109
115
|
this._proxy.$onDidTriggerItemButton(sessionId, e.item.handle, e.button.handle);
|
|
110
|
-
});
|
|
116
|
+
}));
|
|
111
117
|
}
|
|
112
118
|
session = {
|
|
113
119
|
input,
|
|
114
|
-
handlesToItems: ( new Map())
|
|
120
|
+
handlesToItems: ( new Map()),
|
|
121
|
+
store
|
|
115
122
|
};
|
|
116
123
|
this.sessions.set(sessionId, session);
|
|
117
124
|
}
|
|
@@ -171,7 +178,7 @@ let MainThreadQuickOpen = class MainThreadQuickOpen {
|
|
|
171
178
|
$dispose(sessionId) {
|
|
172
179
|
const session = this.sessions.get(sessionId);
|
|
173
180
|
if (session) {
|
|
174
|
-
session.
|
|
181
|
+
session.store.dispose();
|
|
175
182
|
this.sessions.delete(sessionId);
|
|
176
183
|
}
|
|
177
184
|
return Promise.resolve(undefined);
|
|
@@ -141,6 +141,9 @@ class MainThreadSCMHistoryProvider {
|
|
|
141
141
|
this.handle = handle;
|
|
142
142
|
this.currentHistoryItemGroupId = derived(this, reader => this.currentHistoryItemGroup.read(reader)?.id);
|
|
143
143
|
this.currentHistoryItemGroupName = derived(this, reader => this.currentHistoryItemGroup.read(reader)?.name);
|
|
144
|
+
this.currentHistoryItemGroupRevision = derived(this, reader => this.currentHistoryItemGroup.read(reader)?.revision);
|
|
145
|
+
this.currentHistoryItemGroupRemoteId = derived(this, reader => this.currentHistoryItemGroup.read(reader)?.remote?.id);
|
|
146
|
+
this.currentHistoryItemGroupRemoteRevision = derived(this, reader => this.currentHistoryItemGroup.read(reader)?.remote?.revision);
|
|
144
147
|
this._currentHistoryItemGroup = observableValueOpts({ owner: this, equalsFn: () => false }, undefined);
|
|
145
148
|
}
|
|
146
149
|
async resolveHistoryItemGroupCommonAncestor(historyItemGroupId1, historyItemGroupId2) {
|
|
@@ -16,7 +16,7 @@ class ExtHostSaveParticipant {
|
|
|
16
16
|
return undefined;
|
|
17
17
|
}
|
|
18
18
|
const p = ( (new Promise((resolve, reject) => {
|
|
19
|
-
setTimeout(() => reject(( (new Error(( localize(
|
|
19
|
+
setTimeout(() => reject(( (new Error(( localize(4932, "Aborted onWillSaveTextDocument-event after 1750ms")))))), 1750);
|
|
20
20
|
this._proxy.$participateInSave(editorModel.resource, context.reason).then(values => {
|
|
21
21
|
if (!values.every(success => success)) {
|
|
22
22
|
return Promise.reject(( (new Error('listener failed'))));
|
|
@@ -377,7 +377,7 @@ var TaskDTO;
|
|
|
377
377
|
}
|
|
378
378
|
command.presentation = TaskPresentationOptionsDTO.to(task.presentationOptions);
|
|
379
379
|
const source = TaskSourceDTO.to(task.source, workspace);
|
|
380
|
-
const label = ( localize(
|
|
380
|
+
const label = ( localize(4943, '{0}: {1}', source.label, task.name));
|
|
381
381
|
const definition = TaskDefinitionDTO.to(task.definition, executeOnly);
|
|
382
382
|
const id = (CustomExecutionDTO.is(task.execution) && task._id) ? task._id : `${task.source.extensionId}.${definition._key}`;
|
|
383
383
|
const result = ( (new
|
|
@@ -36,7 +36,7 @@ let MainThreadTerminalShellIntegration = class MainThreadTerminalShellIntegratio
|
|
|
36
36
|
const instanceId = e.instance.instanceId;
|
|
37
37
|
this._proxy.$shellExecutionStart(instanceId, e.data.command, convertToExtHostCommandLineConfidence(e.data), e.data.isTrusted, this._convertCwdToUri(e.data.cwd));
|
|
38
38
|
instanceDataListeners.get(instanceId)?.dispose();
|
|
39
|
-
instanceDataListeners.set(instanceId, Event.accumulate(e.instance.onData, 50, this._store)(events => this._proxy.$shellExecutionData(instanceId, events.join())));
|
|
39
|
+
instanceDataListeners.set(instanceId, Event.accumulate(e.instance.onData, 50, this._store)(events => this._proxy.$shellExecutionData(instanceId, events.join(''))));
|
|
40
40
|
}));
|
|
41
41
|
const commandDetectionEndEvent = this._store.add(this._terminalService.createOnInstanceCapabilityEvent(TerminalCapability.CommandDetection, e => e.onCommandFinished));
|
|
42
42
|
this._store.add(commandDetectionEndEvent.event(e => {
|