@codingame/monaco-vscode-extensions-service-override 3.2.3 → 4.1.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.
Files changed (108) hide show
  1. package/extensions.js +6 -87
  2. package/override/vs/platform/dialogs/common/dialogs.js +2 -0
  3. package/package.json +9 -9
  4. package/_virtual/semver.js +0 -3
  5. package/external/vscode-semver/semver.js +0 -985
  6. package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -8
  7. package/vscode/src/vs/base/common/console.js +0 -59
  8. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +0 -497
  9. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +0 -44
  10. package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -27
  11. package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -98
  12. package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +0 -31
  13. package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +0 -35
  14. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +0 -227
  15. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +0 -68
  16. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +0 -103
  17. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +0 -83
  18. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -203
  19. package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +0 -201
  20. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -41
  21. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -24
  22. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -107
  23. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -98
  24. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -545
  25. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -80
  26. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -35
  27. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -578
  28. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -424
  29. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -102
  30. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -69
  31. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -68
  32. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -79
  33. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -253
  34. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -370
  35. package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -22
  36. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -41
  37. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -414
  38. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -482
  39. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -227
  40. package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -24
  41. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -317
  42. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -208
  43. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -374
  44. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
  45. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -28
  46. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
  47. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -27
  48. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -991
  49. package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +0 -78
  50. package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +0 -35
  51. package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +0 -78
  52. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +0 -93
  53. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +0 -137
  54. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -194
  55. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -123
  56. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -188
  57. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -129
  58. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -131
  59. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -374
  60. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -25
  61. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -48
  62. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +0 -76
  63. package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +0 -38
  64. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +0 -68
  65. package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +0 -42
  66. package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +0 -185
  67. package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +0 -30
  68. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +0 -493
  69. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +0 -49
  70. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +0 -146
  71. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +0 -70
  72. package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +0 -50
  73. package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +0 -99
  74. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +0 -53
  75. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +0 -72
  76. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +0 -731
  77. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +0 -53
  78. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +0 -408
  79. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -195
  80. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -24
  81. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -55
  82. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -312
  83. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -223
  84. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -110
  85. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -61
  86. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -29
  87. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -283
  88. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -100
  89. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -135
  90. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -57
  91. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -268
  92. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -35
  93. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -73
  94. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -83
  95. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -284
  96. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -276
  97. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -52
  98. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1138
  99. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -41
  100. package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -25
  101. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -512
  102. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -274
  103. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -58
  104. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -80
  105. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +0 -64
  106. package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +0 -161
  107. package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -49
  108. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -222
@@ -1,374 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { isNonEmptyArray } from 'vscode/vscode/vs/base/common/arrays';
3
- import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
4
- import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
5
- import { Emitter } from 'vscode/vscode/vs/base/common/event';
6
- import { DisposableMap, DisposableStore, toDisposable, combinedDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
7
- import { URI } from 'vscode/vscode/vs/base/common/uri';
8
- import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
9
- import { NotebookDto } from './mainThreadNotebookDto.js';
10
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
11
- import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService';
12
- import { INotebookExecutionStateService, NotebookExecutionType } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
13
- import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
14
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
15
- import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
16
- import { AsyncIterableSource } from 'vscode/vscode/vs/base/common/async';
17
-
18
- class MainThreadKernel {
19
- get preloadUris() {
20
- return ( this.preloads.map(p => p.uri));
21
- }
22
- get preloadProvides() {
23
- return this.preloads.flatMap(p => p.provides);
24
- }
25
- constructor(data, _languageService) {
26
- this._languageService = _languageService;
27
- this._onDidChange = ( new Emitter());
28
- this.onDidChange = this._onDidChange.event;
29
- this.id = data.id;
30
- this.viewType = data.notebookType;
31
- this.extension = data.extensionId;
32
- this.implementsInterrupt = data.supportsInterrupt ?? false;
33
- this.label = data.label;
34
- this.description = data.description;
35
- this.detail = data.detail;
36
- this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : _languageService.getRegisteredLanguageIds();
37
- this.implementsExecutionOrder = data.supportsExecutionOrder ?? false;
38
- this.hasVariableProvider = data.hasVariableProvider ?? false;
39
- this.localResourceRoot = URI.revive(data.extensionLocation);
40
- this.preloads = data.preloads?.map(u => ({ uri: URI.revive(u.uri), provides: u.provides })) ?? [];
41
- }
42
- update(data) {
43
- const event = Object.create(null);
44
- if (data.label !== undefined) {
45
- this.label = data.label;
46
- event.label = true;
47
- }
48
- if (data.description !== undefined) {
49
- this.description = data.description;
50
- event.description = true;
51
- }
52
- if (data.detail !== undefined) {
53
- this.detail = data.detail;
54
- event.detail = true;
55
- }
56
- if (data.supportedLanguages !== undefined) {
57
- this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : this._languageService.getRegisteredLanguageIds();
58
- event.supportedLanguages = true;
59
- }
60
- if (data.supportsExecutionOrder !== undefined) {
61
- this.implementsExecutionOrder = data.supportsExecutionOrder;
62
- event.hasExecutionOrder = true;
63
- }
64
- if (data.supportsInterrupt !== undefined) {
65
- this.implementsInterrupt = data.supportsInterrupt;
66
- event.hasInterruptHandler = true;
67
- }
68
- if (data.hasVariableProvider !== undefined) {
69
- this.hasVariableProvider = data.hasVariableProvider;
70
- event.hasVariableProvider = true;
71
- }
72
- this._onDidChange.fire(event);
73
- }
74
- }
75
- class MainThreadKernelDetectionTask {
76
- constructor(notebookType) {
77
- this.notebookType = notebookType;
78
- }
79
- }
80
- let MainThreadNotebookKernels = class MainThreadNotebookKernels {
81
- constructor(extHostContext, _languageService, _notebookKernelService, _notebookExecutionStateService, _notebookService, notebookEditorService) {
82
- this._languageService = _languageService;
83
- this._notebookKernelService = _notebookKernelService;
84
- this._notebookExecutionStateService = _notebookExecutionStateService;
85
- this._notebookService = _notebookService;
86
- this._editors = ( new DisposableMap());
87
- this._disposables = ( new DisposableStore());
88
- this._kernels = ( new Map());
89
- this._kernelDetectionTasks = ( new Map());
90
- this._kernelSourceActionProviders = ( new Map());
91
- this._kernelSourceActionProvidersEventRegistrations = ( new Map());
92
- this._executions = ( new Map());
93
- this._notebookExecutions = ( new Map());
94
- this.variableRequestIndex = 0;
95
- this.variableRequestMap = ( new Map());
96
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookKernels));
97
- notebookEditorService.listNotebookEditors().forEach(this._onEditorAdd, this);
98
- notebookEditorService.onDidAddNotebookEditor(this._onEditorAdd, this, this._disposables);
99
- notebookEditorService.onDidRemoveNotebookEditor(this._onEditorRemove, this, this._disposables);
100
- this._disposables.add(toDisposable(() => {
101
- this._executions.forEach(e => {
102
- e.complete({});
103
- });
104
- this._notebookExecutions.forEach(e => e.complete());
105
- }));
106
- this._disposables.add(this._notebookExecutionStateService.onDidChangeExecution(e => {
107
- if (e.type === NotebookExecutionType.cell) {
108
- this._proxy.$cellExecutionChanged(e.notebook, e.cellHandle, e.changed?.state);
109
- }
110
- }));
111
- }
112
- dispose() {
113
- this._disposables.dispose();
114
- for (const [, registration] of ( this._kernels.values())) {
115
- registration.dispose();
116
- }
117
- for (const [, registration] of ( this._kernelDetectionTasks.values())) {
118
- registration.dispose();
119
- }
120
- for (const [, registration] of ( this._kernelSourceActionProviders.values())) {
121
- registration.dispose();
122
- }
123
- this._editors.dispose();
124
- }
125
- _onEditorAdd(editor) {
126
- const ipcListener = editor.onDidReceiveMessage(e => {
127
- if (!editor.hasModel()) {
128
- return;
129
- }
130
- const { selected } = this._notebookKernelService.getMatchingKernel(editor.textModel);
131
- if (!selected) {
132
- return;
133
- }
134
- for (const [handle, candidate] of this._kernels) {
135
- if (candidate[0] === selected) {
136
- this._proxy.$acceptKernelMessageFromRenderer(handle, editor.getId(), e.message);
137
- break;
138
- }
139
- }
140
- });
141
- this._editors.set(editor, ipcListener);
142
- }
143
- _onEditorRemove(editor) {
144
- this._editors.deleteAndDispose(editor);
145
- }
146
- async $postMessage(handle, editorId, message) {
147
- const tuple = this._kernels.get(handle);
148
- if (!tuple) {
149
- throw new Error('kernel already disposed');
150
- }
151
- const [kernel] = tuple;
152
- let didSend = false;
153
- for (const [editor] of this._editors) {
154
- if (!editor.hasModel()) {
155
- continue;
156
- }
157
- if (this._notebookKernelService.getMatchingKernel(editor.textModel).selected !== kernel) {
158
- continue;
159
- }
160
- if (editorId === undefined) {
161
- editor.postMessage(message);
162
- didSend = true;
163
- }
164
- else if (editor.getId() === editorId) {
165
- editor.postMessage(message);
166
- didSend = true;
167
- break;
168
- }
169
- }
170
- return didSend;
171
- }
172
- $receiveVariable(requestId, variable) {
173
- const source = this.variableRequestMap.get(requestId);
174
- if (source) {
175
- source.emitOne(variable);
176
- }
177
- }
178
- async $addKernel(handle, data) {
179
- const that = this;
180
- const kernel = new (class extends MainThreadKernel {
181
- async executeNotebookCellsRequest(uri, handles) {
182
- await that._proxy.$executeCells(handle, uri, handles);
183
- }
184
- async cancelNotebookCellExecution(uri, handles) {
185
- await that._proxy.$cancelCells(handle, uri, handles);
186
- }
187
- provideVariables(notebookUri, parentId, kind, start, token) {
188
- const requestId = `${handle}variables${that.variableRequestIndex++}`;
189
- if (( that.variableRequestMap.has(requestId))) {
190
- return that.variableRequestMap.get(requestId).asyncIterable;
191
- }
192
- const source = ( new AsyncIterableSource());
193
- that.variableRequestMap.set(requestId, source);
194
- that._proxy.$provideVariables(handle, requestId, notebookUri, parentId, kind, start, token).then(() => {
195
- source.resolve();
196
- that.variableRequestMap.delete(requestId);
197
- }).catch((err) => {
198
- source.reject(err);
199
- that.variableRequestMap.delete(requestId);
200
- });
201
- return source.asyncIterable;
202
- }
203
- })(data, this._languageService);
204
- const listener = this._notebookKernelService.onDidChangeSelectedNotebooks(e => {
205
- if (e.oldKernel === kernel.id) {
206
- this._proxy.$acceptNotebookAssociation(handle, e.notebook, false);
207
- }
208
- else if (e.newKernel === kernel.id) {
209
- this._proxy.$acceptNotebookAssociation(handle, e.notebook, true);
210
- }
211
- });
212
- const registration = this._notebookKernelService.registerKernel(kernel);
213
- this._kernels.set(handle, [kernel, combinedDisposable(listener, registration)]);
214
- }
215
- $updateKernel(handle, data) {
216
- const tuple = this._kernels.get(handle);
217
- if (tuple) {
218
- tuple[0].update(data);
219
- }
220
- }
221
- $removeKernel(handle) {
222
- const tuple = this._kernels.get(handle);
223
- if (tuple) {
224
- tuple[1].dispose();
225
- this._kernels.delete(handle);
226
- }
227
- }
228
- $updateNotebookPriority(handle, notebook, value) {
229
- const tuple = this._kernels.get(handle);
230
- if (tuple) {
231
- this._notebookKernelService.updateKernelNotebookAffinity(tuple[0], URI.revive(notebook), value);
232
- }
233
- }
234
- $createExecution(handle, controllerId, rawUri, cellHandle) {
235
- const uri = URI.revive(rawUri);
236
- const notebook = this._notebookService.getNotebookTextModel(uri);
237
- if (!notebook) {
238
- throw new Error(`Notebook not found: ${uri.toString()}`);
239
- }
240
- const kernel = this._notebookKernelService.getMatchingKernel(notebook);
241
- if (!kernel.selected || kernel.selected.id !== controllerId) {
242
- throw new Error(`Kernel is not selected: ${kernel.selected?.id} !== ${controllerId}`);
243
- }
244
- const execution = this._notebookExecutionStateService.createCellExecution(uri, cellHandle);
245
- execution.confirm();
246
- this._executions.set(handle, execution);
247
- }
248
- $updateExecution(handle, data) {
249
- const updates = data.value;
250
- try {
251
- const execution = this._executions.get(handle);
252
- execution?.update(( updates.map(NotebookDto.fromCellExecuteUpdateDto)));
253
- }
254
- catch (e) {
255
- onUnexpectedError(e);
256
- }
257
- }
258
- $completeExecution(handle, data) {
259
- try {
260
- const execution = this._executions.get(handle);
261
- execution?.complete(NotebookDto.fromCellExecuteCompleteDto(data.value));
262
- }
263
- catch (e) {
264
- onUnexpectedError(e);
265
- }
266
- finally {
267
- this._executions.delete(handle);
268
- }
269
- }
270
- $createNotebookExecution(handle, controllerId, rawUri) {
271
- const uri = URI.revive(rawUri);
272
- const notebook = this._notebookService.getNotebookTextModel(uri);
273
- if (!notebook) {
274
- throw new Error(`Notebook not found: ${uri.toString()}`);
275
- }
276
- const kernel = this._notebookKernelService.getMatchingKernel(notebook);
277
- if (!kernel.selected || kernel.selected.id !== controllerId) {
278
- throw new Error(`Kernel is not selected: ${kernel.selected?.id} !== ${controllerId}`);
279
- }
280
- const execution = this._notebookExecutionStateService.createExecution(uri);
281
- execution.confirm();
282
- this._notebookExecutions.set(handle, execution);
283
- }
284
- $beginNotebookExecution(handle) {
285
- try {
286
- const execution = this._notebookExecutions.get(handle);
287
- execution?.begin();
288
- }
289
- catch (e) {
290
- onUnexpectedError(e);
291
- }
292
- }
293
- $completeNotebookExecution(handle) {
294
- try {
295
- const execution = this._notebookExecutions.get(handle);
296
- execution?.complete();
297
- }
298
- catch (e) {
299
- onUnexpectedError(e);
300
- }
301
- finally {
302
- this._notebookExecutions.delete(handle);
303
- }
304
- }
305
- async $addKernelDetectionTask(handle, notebookType) {
306
- const kernelDetectionTask = ( new MainThreadKernelDetectionTask(notebookType));
307
- const registration = this._notebookKernelService.registerNotebookKernelDetectionTask(kernelDetectionTask);
308
- this._kernelDetectionTasks.set(handle, [kernelDetectionTask, registration]);
309
- }
310
- $removeKernelDetectionTask(handle) {
311
- const tuple = this._kernelDetectionTasks.get(handle);
312
- if (tuple) {
313
- tuple[1].dispose();
314
- this._kernelDetectionTasks.delete(handle);
315
- }
316
- }
317
- async $addKernelSourceActionProvider(handle, eventHandle, notebookType) {
318
- const kernelSourceActionProvider = {
319
- viewType: notebookType,
320
- provideKernelSourceActions: async () => {
321
- const actions = await this._proxy.$provideKernelSourceActions(handle, CancellationToken.None);
322
- return ( actions.map(action => {
323
- let documentation = action.documentation;
324
- if (action.documentation && typeof action.documentation !== 'string') {
325
- documentation = URI.revive(action.documentation);
326
- }
327
- return {
328
- label: action.label,
329
- command: action.command,
330
- description: action.description,
331
- detail: action.detail,
332
- documentation,
333
- };
334
- }));
335
- }
336
- };
337
- if (typeof eventHandle === 'number') {
338
- const emitter = ( new Emitter());
339
- this._kernelSourceActionProvidersEventRegistrations.set(eventHandle, emitter);
340
- kernelSourceActionProvider.onDidChangeSourceActions = emitter.event;
341
- }
342
- const registration = this._notebookKernelService.registerKernelSourceActionProvider(notebookType, kernelSourceActionProvider);
343
- this._kernelSourceActionProviders.set(handle, [kernelSourceActionProvider, registration]);
344
- }
345
- $removeKernelSourceActionProvider(handle, eventHandle) {
346
- const tuple = this._kernelSourceActionProviders.get(handle);
347
- if (tuple) {
348
- tuple[1].dispose();
349
- this._kernelSourceActionProviders.delete(handle);
350
- }
351
- if (typeof eventHandle === 'number') {
352
- this._kernelSourceActionProvidersEventRegistrations.delete(eventHandle);
353
- }
354
- }
355
- $emitNotebookKernelSourceActionsChangeEvent(eventHandle) {
356
- const emitter = this._kernelSourceActionProvidersEventRegistrations.get(eventHandle);
357
- if (emitter instanceof Emitter) {
358
- emitter.fire(undefined);
359
- }
360
- }
361
- $variablesUpdated(notebookUri) {
362
- this._notebookKernelService.notifyVariablesChange(URI.revive(notebookUri));
363
- }
364
- };
365
- MainThreadNotebookKernels = __decorate([
366
- extHostNamedCustomer(MainContext.MainThreadNotebookKernels),
367
- ( __param(1, ILanguageService)),
368
- ( __param(2, INotebookKernelService)),
369
- ( __param(3, INotebookExecutionStateService)),
370
- ( __param(4, INotebookService)),
371
- ( __param(5, INotebookEditorService))
372
- ], MainThreadNotebookKernels);
373
-
374
- export { MainThreadNotebookKernels };
@@ -1,25 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
4
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
5
- import { INotebookRendererMessagingService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRendererMessagingService';
6
-
7
- let MainThreadNotebookRenderers = class MainThreadNotebookRenderers extends Disposable {
8
- constructor(extHostContext, messaging) {
9
- super();
10
- this.messaging = messaging;
11
- this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookRenderers));
12
- this._register(messaging.onShouldPostMessage(e => {
13
- this.proxy.$postRendererMessage(e.editorId, e.rendererId, e.message);
14
- }));
15
- }
16
- $postMessage(editorId, rendererId, message) {
17
- return this.messaging.receiveMessage(editorId, rendererId, message);
18
- }
19
- };
20
- MainThreadNotebookRenderers = __decorate([
21
- extHostNamedCustomer(MainContext.MainThreadNotebookRenderers),
22
- ( __param(1, INotebookRendererMessagingService))
23
- ], MainThreadNotebookRenderers);
24
-
25
- export { MainThreadNotebookRenderers };
@@ -1,48 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
- import { extHostCustomer } from '../../services/extensions/common/extHostCustomers.js';
5
- import { ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
6
- import { raceCancellationError } from 'vscode/vscode/vs/base/common/async';
7
- import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
8
- import { NotebookFileWorkingCopyModel } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel';
9
-
10
- class ExtHostNotebookDocumentSaveParticipant {
11
- constructor(extHostContext) {
12
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookDocumentSaveParticipant));
13
- }
14
- async participate(workingCopy, context, _progress, token) {
15
- if (!workingCopy.model || !(workingCopy.model instanceof NotebookFileWorkingCopyModel)) {
16
- return undefined;
17
- }
18
- let _warningTimeout;
19
- const p = ( new Promise((resolve, reject) => {
20
- _warningTimeout = setTimeout(() => reject(( new Error(( localizeWithPath(
21
- 'vs/workbench/api/browser/mainThreadNotebookSaveParticipant',
22
- 'timeout.onWillSave',
23
- "Aborted onWillSaveNotebookDocument-event after 1750ms"
24
- ))))), 1750);
25
- this._proxy.$participateInSave(workingCopy.resource, context.reason, token).then(_ => {
26
- clearTimeout(_warningTimeout);
27
- return undefined;
28
- }).then(resolve, reject);
29
- }));
30
- return raceCancellationError(p, token);
31
- }
32
- }
33
- let SaveParticipant = class SaveParticipant {
34
- constructor(extHostContext, instantiationService, workingCopyFileService) {
35
- this.workingCopyFileService = workingCopyFileService;
36
- this._saveParticipantDisposable = this.workingCopyFileService.addSaveParticipant(instantiationService.createInstance(ExtHostNotebookDocumentSaveParticipant, extHostContext));
37
- }
38
- dispose() {
39
- this._saveParticipantDisposable.dispose();
40
- }
41
- };
42
- SaveParticipant = __decorate([
43
- extHostCustomer,
44
- ( __param(1, IInstantiationService)),
45
- ( __param(2, IWorkingCopyFileService))
46
- ], SaveParticipant);
47
-
48
- export { SaveParticipant };
@@ -1,76 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
3
- import { OUTPUT_VIEW_ID, Extensions, OutputChannelUpdateMode, IOutputService } from 'vscode/vscode/vs/workbench/services/output/common/output';
4
- import { ExtHostContext, MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
5
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
- import { URI } from 'vscode/vscode/vs/base/common/uri';
7
- import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
8
- import { Event } from 'vscode/vscode/vs/base/common/event';
9
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
10
- import { isNumber } from 'vscode/vscode/vs/base/common/types';
11
-
12
- var MainThreadOutputService_1;
13
- let MainThreadOutputService = class MainThreadOutputService extends Disposable {
14
- static { MainThreadOutputService_1 = this; }
15
- static { this._extensionIdPool = ( new Map()); }
16
- constructor(extHostContext, outputService, viewsService) {
17
- super();
18
- this._outputService = outputService;
19
- this._viewsService = viewsService;
20
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostOutputService));
21
- const setVisibleChannel = () => {
22
- const visibleChannel = this._viewsService.isViewVisible(OUTPUT_VIEW_ID) ? this._outputService.getActiveChannel() : undefined;
23
- this._proxy.$setVisibleChannel(visibleChannel ? visibleChannel.id : null);
24
- };
25
- this._register(Event.any(this._outputService.onActiveOutputChannel, Event.filter(this._viewsService.onDidChangeViewVisibility, ({ id }) => id === OUTPUT_VIEW_ID))(() => setVisibleChannel()));
26
- setVisibleChannel();
27
- }
28
- async $register(label, file, languageId, extensionId) {
29
- const idCounter = (MainThreadOutputService_1._extensionIdPool.get(extensionId) || 0) + 1;
30
- MainThreadOutputService_1._extensionIdPool.set(extensionId, idCounter);
31
- const id = `extension-output-${extensionId}-#${idCounter}-${label}`;
32
- const resource = URI.revive(file);
33
- ( Registry.as(Extensions.OutputChannels)).registerChannel({ id, label, file: resource, log: false, languageId, extensionId });
34
- this._register(toDisposable(() => this.$dispose(id)));
35
- return id;
36
- }
37
- async $update(channelId, mode, till) {
38
- const channel = this._getChannel(channelId);
39
- if (channel) {
40
- if (mode === OutputChannelUpdateMode.Append) {
41
- channel.update(mode);
42
- }
43
- else if (isNumber(till)) {
44
- channel.update(mode, till);
45
- }
46
- }
47
- }
48
- async $reveal(channelId, preserveFocus) {
49
- const channel = this._getChannel(channelId);
50
- if (channel) {
51
- this._outputService.showChannel(channel.id, preserveFocus);
52
- }
53
- }
54
- async $close(channelId) {
55
- if (this._viewsService.isViewVisible(OUTPUT_VIEW_ID)) {
56
- const activeChannel = this._outputService.getActiveChannel();
57
- if (activeChannel && channelId === activeChannel.id) {
58
- this._viewsService.closeView(OUTPUT_VIEW_ID);
59
- }
60
- }
61
- }
62
- async $dispose(channelId) {
63
- const channel = this._getChannel(channelId);
64
- channel?.dispose();
65
- }
66
- _getChannel(channelId) {
67
- return this._outputService.getChannel(channelId);
68
- }
69
- };
70
- MainThreadOutputService = MainThreadOutputService_1 = __decorate([
71
- extHostNamedCustomer(MainContext.MainThreadOutputService),
72
- ( __param(1, IOutputService)),
73
- ( __param(2, IViewsService))
74
- ], MainThreadOutputService);
75
-
76
- export { MainThreadOutputService };
@@ -1,38 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { revive } from 'vscode/vscode/vs/base/common/marshalling';
4
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
5
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
6
- import { IUserDataProfileImportExportService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
7
-
8
- let MainThreadProfileContentHandlers = class MainThreadProfileContentHandlers extends Disposable {
9
- constructor(context, userDataProfileImportExportService) {
10
- super();
11
- this.userDataProfileImportExportService = userDataProfileImportExportService;
12
- this.registeredHandlers = this._register(( new DisposableMap()));
13
- this.proxy = ( context.getProxy(ExtHostContext.ExtHostProfileContentHandlers));
14
- }
15
- async $registerProfileContentHandler(id, name, description, extensionId) {
16
- this.registeredHandlers.set(id, this.userDataProfileImportExportService.registerProfileContentHandler(id, {
17
- name,
18
- description,
19
- extensionId,
20
- saveProfile: async (name, content, token) => {
21
- const result = await this.proxy.$saveProfile(id, name, content, token);
22
- return result ? revive(result) : null;
23
- },
24
- readProfile: async (uri, token) => {
25
- return this.proxy.$readProfile(id, uri, token);
26
- },
27
- }));
28
- }
29
- async $unregisterProfileContentHandler(id) {
30
- this.registeredHandlers.deleteAndDispose(id);
31
- }
32
- };
33
- MainThreadProfileContentHandlers = __decorate([
34
- extHostNamedCustomer(MainContext.MainThreadProfileContentHandlers),
35
- ( __param(1, IUserDataProfileImportExportService))
36
- ], MainThreadProfileContentHandlers);
37
-
38
- export { MainThreadProfileContentHandlers };
@@ -1,68 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress';
3
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
4
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
5
- import { Action } from 'vscode/vscode/vs/base/common/actions';
6
- import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
7
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
8
-
9
- class ManageExtensionAction extends Action {
10
- constructor(extensionId, label, commandService) {
11
- super(extensionId, label, undefined, true, () => {
12
- return commandService.executeCommand('_extensions.manage', extensionId);
13
- });
14
- }
15
- }
16
- let MainThreadProgress = class MainThreadProgress {
17
- constructor(extHostContext, progressService, _commandService) {
18
- this._commandService = _commandService;
19
- this._progress = ( new Map());
20
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostProgress));
21
- this._progressService = progressService;
22
- }
23
- dispose() {
24
- this._progress.forEach(handle => handle.resolve());
25
- this._progress.clear();
26
- }
27
- async $startProgress(handle, options, extensionId) {
28
- const task = this._createTask(handle);
29
- if (options.location === 15 && extensionId) {
30
- const notificationOptions = {
31
- ...options,
32
- location: 15 ,
33
- secondaryActions: [( new ManageExtensionAction(extensionId, ( localizeWithPath(
34
- 'vs/workbench/api/browser/mainThreadProgress',
35
- 'manageExtension',
36
- "Manage Extension"
37
- )), this._commandService))]
38
- };
39
- options = notificationOptions;
40
- }
41
- this._progressService.withProgress(options, task, () => this._proxy.$acceptProgressCanceled(handle));
42
- }
43
- $progressReport(handle, message) {
44
- const entry = this._progress.get(handle);
45
- entry?.progress.report(message);
46
- }
47
- $progressEnd(handle) {
48
- const entry = this._progress.get(handle);
49
- if (entry) {
50
- entry.resolve();
51
- this._progress.delete(handle);
52
- }
53
- }
54
- _createTask(handle) {
55
- return (progress) => {
56
- return ( new Promise(resolve => {
57
- this._progress.set(handle, { resolve, progress });
58
- }));
59
- };
60
- }
61
- };
62
- MainThreadProgress = __decorate([
63
- extHostNamedCustomer(MainContext.MainThreadProgress),
64
- ( __param(1, IProgressService)),
65
- ( __param(2, ICommandService))
66
- ], MainThreadProgress);
67
-
68
- export { MainThreadProgress };
@@ -1,42 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
3
- import { DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { URI } from 'vscode/vscode/vs/base/common/uri';
5
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
6
- import { IQuickDiffService } from 'vscode/vscode/vs/workbench/contrib/scm/common/quickDiff';
7
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
8
-
9
- let MainThreadQuickDiff = class MainThreadQuickDiff {
10
- constructor(extHostContext, quickDiffService) {
11
- this.quickDiffService = quickDiffService;
12
- this.providerDisposables = ( new DisposableMap());
13
- this.proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostQuickDiff));
14
- }
15
- async $registerQuickDiffProvider(handle, selector, label, rootUri) {
16
- const provider = {
17
- label,
18
- rootUri: URI.revive(rootUri),
19
- selector,
20
- isSCM: false,
21
- getOriginalResource: async (uri) => {
22
- return URI.revive(await this.proxy.$provideOriginalResource(handle, uri, ( new CancellationTokenSource()).token));
23
- }
24
- };
25
- const disposable = this.quickDiffService.addQuickDiffProvider(provider);
26
- this.providerDisposables.set(handle, disposable);
27
- }
28
- async $unregisterQuickDiffProvider(handle) {
29
- if (( this.providerDisposables.has(handle))) {
30
- this.providerDisposables.deleteAndDispose(handle);
31
- }
32
- }
33
- dispose() {
34
- this.providerDisposables.dispose();
35
- }
36
- };
37
- MainThreadQuickDiff = __decorate([
38
- extHostNamedCustomer(MainContext.MainThreadQuickDiff),
39
- ( __param(1, IQuickDiffService))
40
- ], MainThreadQuickDiff);
41
-
42
- export { MainThreadQuickDiff };