@codingame/monaco-vscode-extensions-service-override 4.0.0 → 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 (109) hide show
  1. package/extensions.js +6 -6
  2. package/package.json +9 -9
  3. package/_virtual/semver.js +0 -3
  4. package/external/vscode-semver/semver.js +0 -985
  5. package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -8
  6. package/vscode/src/vs/base/common/console.js +0 -62
  7. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +0 -497
  8. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +0 -44
  9. package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +0 -27
  10. package/vscode/src/vs/platform/remote/common/managedSocket.js +0 -98
  11. package/vscode/src/vs/workbench/api/browser/extensionHost.contribution.js +0 -104
  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 -254
  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 -70
  18. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -207
  19. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +0 -41
  20. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +0 -24
  21. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +0 -108
  22. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +0 -98
  23. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +0 -560
  24. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +0 -80
  25. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +0 -35
  26. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +0 -579
  27. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +0 -435
  28. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +0 -102
  29. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +0 -69
  30. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +0 -68
  31. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +0 -79
  32. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -253
  33. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +0 -370
  34. package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +0 -22
  35. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +0 -41
  36. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +0 -414
  37. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +0 -501
  38. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +0 -227
  39. package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +0 -24
  40. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +0 -317
  41. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +0 -208
  42. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +0 -369
  43. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +0 -72
  44. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +0 -28
  45. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +0 -50
  46. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +0 -27
  47. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +0 -1016
  48. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +0 -185
  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/mainThreadProfileContentHandlers.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 -168
  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 -409
  79. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +0 -51
  80. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +0 -219
  81. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +0 -24
  82. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +0 -55
  83. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +0 -312
  84. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +0 -223
  85. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +0 -110
  86. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +0 -61
  87. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +0 -29
  88. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +0 -283
  89. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +0 -100
  90. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +0 -135
  91. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +0 -57
  92. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +0 -268
  93. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +0 -35
  94. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +0 -76
  95. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +0 -83
  96. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +0 -285
  97. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +0 -276
  98. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +0 -52
  99. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +0 -1149
  100. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -41
  101. package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +0 -25
  102. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +0 -512
  103. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +0 -274
  104. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +0 -58
  105. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +0 -80
  106. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +0 -64
  107. package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +0 -161
  108. package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +0 -49
  109. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +0 -222
@@ -1,560 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { Emitter } from 'vscode/vscode/vs/base/common/event';
3
- import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { URI } from 'vscode/vscode/vs/base/common/uri';
5
- import { Range } from 'vscode/vscode/vs/editor/common/core/range';
6
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
7
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
8
- import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService';
9
- import { CommentsPanel } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsView';
10
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
11
- import { COMMENTS_VIEW_ID, COMMENTS_VIEW_TITLE, COMMENTS_VIEW_STORAGE_ID } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsTreeViewer';
12
- import { IViewDescriptorService, Extensions } from 'vscode/vscode/vs/workbench/common/views';
13
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
14
- import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
15
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
16
- import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
17
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
18
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
19
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
20
-
21
- class MainThreadCommentThread {
22
- get input() {
23
- return this._input;
24
- }
25
- set input(value) {
26
- this._input = value;
27
- this._onDidChangeInput.fire(value);
28
- }
29
- get onDidChangeInput() { return this._onDidChangeInput.event; }
30
- get label() {
31
- return this._label;
32
- }
33
- set label(label) {
34
- this._label = label;
35
- this._onDidChangeLabel.fire(this._label);
36
- }
37
- get contextValue() {
38
- return this._contextValue;
39
- }
40
- set contextValue(context) {
41
- this._contextValue = context;
42
- }
43
- get comments() {
44
- return this._comments;
45
- }
46
- set comments(newComments) {
47
- this._comments = newComments;
48
- this._onDidChangeComments.fire(this._comments);
49
- }
50
- get onDidChangeComments() { return this._onDidChangeComments.event; }
51
- set range(range) {
52
- this._range = range;
53
- this._onDidChangeRange.fire(this._range);
54
- }
55
- get range() {
56
- return this._range;
57
- }
58
- get onDidChangeCanReply() { return this._onDidChangeCanReply.event; }
59
- set canReply(state) {
60
- this._canReply = state;
61
- this._onDidChangeCanReply.fire(this._canReply);
62
- }
63
- get canReply() {
64
- return this._canReply;
65
- }
66
- get collapsibleState() {
67
- return this._collapsibleState;
68
- }
69
- set collapsibleState(newState) {
70
- this._collapsibleState = newState;
71
- this._onDidChangeCollapsibleState.fire(this._collapsibleState);
72
- }
73
- get initialCollapsibleState() {
74
- return this._initialCollapsibleState;
75
- }
76
- set initialCollapsibleState(initialCollapsibleState) {
77
- this._initialCollapsibleState = initialCollapsibleState;
78
- if (this.collapsibleState === undefined) {
79
- this.collapsibleState = this.initialCollapsibleState;
80
- }
81
- this._onDidChangeInitialCollapsibleState.fire(initialCollapsibleState);
82
- }
83
- get isDisposed() {
84
- return this._isDisposed;
85
- }
86
- isDocumentCommentThread() {
87
- return this._range === undefined || Range.isIRange(this._range);
88
- }
89
- get state() {
90
- return this._state;
91
- }
92
- set state(newState) {
93
- this._state = newState;
94
- this._onDidChangeState.fire(this._state);
95
- }
96
- get applicability() {
97
- return this._applicability;
98
- }
99
- set applicability(value) {
100
- this._applicability = value;
101
- this._onDidChangeApplicability.fire(value);
102
- }
103
- get isTemplate() {
104
- return this._isTemplate;
105
- }
106
- constructor(commentThreadHandle, controllerHandle, extensionId, threadId, resource, _range, _canReply, _isTemplate) {
107
- this.commentThreadHandle = commentThreadHandle;
108
- this.controllerHandle = controllerHandle;
109
- this.extensionId = extensionId;
110
- this.threadId = threadId;
111
- this.resource = resource;
112
- this._range = _range;
113
- this._canReply = _canReply;
114
- this._isTemplate = _isTemplate;
115
- this._onDidChangeInput = ( new Emitter());
116
- this._onDidChangeLabel = ( new Emitter());
117
- this.onDidChangeLabel = this._onDidChangeLabel.event;
118
- this._onDidChangeComments = ( new Emitter());
119
- this._onDidChangeCanReply = ( new Emitter());
120
- this._onDidChangeRange = ( new Emitter());
121
- this.onDidChangeRange = this._onDidChangeRange.event;
122
- this._onDidChangeCollapsibleState = ( new Emitter());
123
- this.onDidChangeCollapsibleState = this._onDidChangeCollapsibleState.event;
124
- this._onDidChangeInitialCollapsibleState = ( new Emitter());
125
- this.onDidChangeInitialCollapsibleState = this._onDidChangeInitialCollapsibleState.event;
126
- this._onDidChangeApplicability = ( new Emitter());
127
- this.onDidChangeApplicability = this._onDidChangeApplicability.event;
128
- this._onDidChangeState = ( new Emitter());
129
- this.onDidChangeState = this._onDidChangeState.event;
130
- this._isDisposed = false;
131
- if (_isTemplate) {
132
- this.comments = [];
133
- }
134
- }
135
- batchUpdate(changes) {
136
- const modified = (value) => Object.prototype.hasOwnProperty.call(changes, value);
137
- if (modified('range')) {
138
- this._range = changes.range;
139
- }
140
- if (modified('label')) {
141
- this._label = changes.label;
142
- }
143
- if (modified('contextValue')) {
144
- this._contextValue = changes.contextValue === null ? undefined : changes.contextValue;
145
- }
146
- if (modified('comments')) {
147
- this._comments = changes.comments;
148
- }
149
- if (modified('collapseState')) {
150
- this.initialCollapsibleState = changes.collapseState;
151
- }
152
- if (modified('canReply')) {
153
- this.canReply = changes.canReply;
154
- }
155
- if (modified('state')) {
156
- this.state = changes.state;
157
- }
158
- if (modified('applicability')) {
159
- this.applicability = changes.applicability;
160
- }
161
- if (modified('isTemplate')) {
162
- this._isTemplate = changes.isTemplate;
163
- }
164
- }
165
- dispose() {
166
- this._isDisposed = true;
167
- this._onDidChangeCollapsibleState.dispose();
168
- this._onDidChangeComments.dispose();
169
- this._onDidChangeInput.dispose();
170
- this._onDidChangeLabel.dispose();
171
- this._onDidChangeRange.dispose();
172
- this._onDidChangeState.dispose();
173
- }
174
- toJSON() {
175
- return {
176
- $mid: 7 ,
177
- commentControlHandle: this.controllerHandle,
178
- commentThreadHandle: this.commentThreadHandle,
179
- };
180
- }
181
- }
182
- class MainThreadCommentController {
183
- get handle() {
184
- return this._handle;
185
- }
186
- get id() {
187
- return this._id;
188
- }
189
- get contextValue() {
190
- return this._id;
191
- }
192
- get proxy() {
193
- return this._proxy;
194
- }
195
- get label() {
196
- return this._label;
197
- }
198
- get reactions() {
199
- return this._reactions;
200
- }
201
- set reactions(reactions) {
202
- this._reactions = reactions;
203
- }
204
- get options() {
205
- return this._features.options;
206
- }
207
- get features() {
208
- return this._features;
209
- }
210
- get owner() {
211
- return this._id;
212
- }
213
- constructor(_proxy, _commentService, _handle, _uniqueId, _id, _label, _features) {
214
- this._proxy = _proxy;
215
- this._commentService = _commentService;
216
- this._handle = _handle;
217
- this._uniqueId = _uniqueId;
218
- this._id = _id;
219
- this._label = _label;
220
- this._features = _features;
221
- this._threads = ( new Map());
222
- }
223
- async setActiveCommentAndThread(commentInfo) {
224
- return this._proxy.$setActiveComment(this._handle, commentInfo ? { commentThreadHandle: commentInfo.thread.commentThreadHandle, uniqueIdInThread: commentInfo.comment?.uniqueIdInThread } : undefined);
225
- }
226
- updateFeatures(features) {
227
- this._features = features;
228
- }
229
- createCommentThread(extensionId, commentThreadHandle, threadId, resource, range, isTemplate) {
230
- const thread = ( new MainThreadCommentThread(commentThreadHandle, this.handle, extensionId, threadId, ( URI.revive(resource).toString()), range, true, isTemplate));
231
- this._threads.set(commentThreadHandle, thread);
232
- if (thread.isDocumentCommentThread()) {
233
- this._commentService.updateComments(this._uniqueId, {
234
- added: [thread],
235
- removed: [],
236
- changed: [],
237
- pending: []
238
- });
239
- }
240
- else {
241
- this._commentService.updateNotebookComments(this._uniqueId, {
242
- added: [thread],
243
- removed: [],
244
- changed: [],
245
- pending: []
246
- });
247
- }
248
- return thread;
249
- }
250
- updateCommentThread(commentThreadHandle, threadId, resource, changes) {
251
- const thread = this.getKnownThread(commentThreadHandle);
252
- thread.batchUpdate(changes);
253
- if (thread.isDocumentCommentThread()) {
254
- this._commentService.updateComments(this._uniqueId, {
255
- added: [],
256
- removed: [],
257
- changed: [thread],
258
- pending: []
259
- });
260
- }
261
- else {
262
- this._commentService.updateNotebookComments(this._uniqueId, {
263
- added: [],
264
- removed: [],
265
- changed: [thread],
266
- pending: []
267
- });
268
- }
269
- }
270
- deleteCommentThread(commentThreadHandle) {
271
- const thread = this.getKnownThread(commentThreadHandle);
272
- this._threads.delete(commentThreadHandle);
273
- thread.dispose();
274
- if (thread.isDocumentCommentThread()) {
275
- this._commentService.updateComments(this._uniqueId, {
276
- added: [],
277
- removed: [thread],
278
- changed: [],
279
- pending: []
280
- });
281
- }
282
- else {
283
- this._commentService.updateNotebookComments(this._uniqueId, {
284
- added: [],
285
- removed: [thread],
286
- changed: [],
287
- pending: []
288
- });
289
- }
290
- }
291
- deleteCommentThreadMain(commentThreadId) {
292
- this._threads.forEach(thread => {
293
- if (thread.threadId === commentThreadId) {
294
- this._proxy.$deleteCommentThread(this._handle, thread.commentThreadHandle);
295
- }
296
- });
297
- }
298
- updateInput(input) {
299
- const thread = this.activeEditingCommentThread;
300
- if (thread && thread.input) {
301
- const commentInput = thread.input;
302
- commentInput.value = input;
303
- thread.input = commentInput;
304
- }
305
- }
306
- updateCommentingRanges(resourceHints) {
307
- this._commentService.updateCommentingRanges(this._uniqueId, resourceHints);
308
- }
309
- getKnownThread(commentThreadHandle) {
310
- const thread = this._threads.get(commentThreadHandle);
311
- if (!thread) {
312
- throw new Error('unknown thread');
313
- }
314
- return thread;
315
- }
316
- async getDocumentComments(resource, token) {
317
- if (resource.scheme === Schemas.vscodeNotebookCell) {
318
- return {
319
- uniqueOwner: this._uniqueId,
320
- label: this.label,
321
- threads: [],
322
- commentingRanges: {
323
- resource: resource,
324
- ranges: [],
325
- fileComments: false
326
- }
327
- };
328
- }
329
- const ret = [];
330
- for (const thread of [...( this._threads.keys())]) {
331
- const commentThread = this._threads.get(thread);
332
- if (commentThread.resource === ( resource.toString())) {
333
- ret.push(commentThread);
334
- }
335
- }
336
- const commentingRanges = await this._proxy.$provideCommentingRanges(this.handle, resource, token);
337
- return {
338
- uniqueOwner: this._uniqueId,
339
- label: this.label,
340
- threads: ret,
341
- commentingRanges: {
342
- resource: resource,
343
- ranges: commentingRanges?.ranges || [],
344
- fileComments: commentingRanges?.fileComments
345
- }
346
- };
347
- }
348
- async getNotebookComments(resource, token) {
349
- if (resource.scheme !== Schemas.vscodeNotebookCell) {
350
- return {
351
- uniqueOwner: this._uniqueId,
352
- label: this.label,
353
- threads: []
354
- };
355
- }
356
- const ret = [];
357
- for (const thread of [...( this._threads.keys())]) {
358
- const commentThread = this._threads.get(thread);
359
- if (commentThread.resource === ( resource.toString())) {
360
- ret.push(commentThread);
361
- }
362
- }
363
- return {
364
- uniqueOwner: this._uniqueId,
365
- label: this.label,
366
- threads: ret
367
- };
368
- }
369
- async toggleReaction(uri, thread, comment, reaction, token) {
370
- return this._proxy.$toggleReaction(this._handle, thread.commentThreadHandle, uri, comment, reaction);
371
- }
372
- getAllComments() {
373
- const ret = [];
374
- for (const thread of [...( this._threads.keys())]) {
375
- ret.push(this._threads.get(thread));
376
- }
377
- return ret;
378
- }
379
- createCommentThreadTemplate(resource, range) {
380
- return this._proxy.$createCommentThreadTemplate(this.handle, resource, range);
381
- }
382
- async updateCommentThreadTemplate(threadHandle, range) {
383
- await this._proxy.$updateCommentThreadTemplate(this.handle, threadHandle, range);
384
- }
385
- toJSON() {
386
- return {
387
- $mid: 6 ,
388
- handle: this.handle
389
- };
390
- }
391
- }
392
- const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localizeWithPath(
393
- 'vs/workbench/api/browser/mainThreadComments',
394
- 'commentsViewIcon',
395
- 'View icon of the comments view.'
396
- )));
397
- let MainThreadComments = class MainThreadComments extends Disposable {
398
- constructor(extHostContext, _commentService, _viewsService, _viewDescriptorService) {
399
- super();
400
- this._commentService = _commentService;
401
- this._viewsService = _viewsService;
402
- this._viewDescriptorService = _viewDescriptorService;
403
- this._handlers = ( new Map());
404
- this._commentControllers = ( new Map());
405
- this._activeEditingCommentThreadDisposables = this._register(( new DisposableStore()));
406
- this._openViewListener = null;
407
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostComments));
408
- this._commentService.unregisterCommentController();
409
- this._register(this._commentService.onDidChangeActiveEditingCommentThread(async (thread) => {
410
- const handle = thread.controllerHandle;
411
- const controller = this._commentControllers.get(handle);
412
- if (!controller) {
413
- return;
414
- }
415
- this._activeEditingCommentThreadDisposables.clear();
416
- this._activeEditingCommentThread = thread;
417
- controller.activeEditingCommentThread = this._activeEditingCommentThread;
418
- }));
419
- }
420
- $registerCommentController(handle, id, label, extensionId) {
421
- const providerId = `${id}-${extensionId}`;
422
- this._handlers.set(handle, providerId);
423
- const provider = ( new MainThreadCommentController(this._proxy, this._commentService, handle, providerId, id, label, {}));
424
- this._commentService.registerCommentController(providerId, provider);
425
- this._commentControllers.set(handle, provider);
426
- const commentsPanelAlreadyConstructed = !!this._viewDescriptorService.getViewDescriptorById(COMMENTS_VIEW_ID);
427
- if (!commentsPanelAlreadyConstructed) {
428
- this.registerView(commentsPanelAlreadyConstructed);
429
- }
430
- this.registerViewListeners(commentsPanelAlreadyConstructed);
431
- this._commentService.setWorkspaceComments(String(handle), []);
432
- }
433
- $unregisterCommentController(handle) {
434
- const providerId = this._handlers.get(handle);
435
- this._handlers.delete(handle);
436
- this._commentControllers.delete(handle);
437
- if (typeof providerId !== 'string') {
438
- return;
439
- }
440
- else {
441
- this._commentService.unregisterCommentController(providerId);
442
- }
443
- }
444
- $updateCommentControllerFeatures(handle, features) {
445
- const provider = this._commentControllers.get(handle);
446
- if (!provider) {
447
- return undefined;
448
- }
449
- provider.updateFeatures(features);
450
- }
451
- $createCommentThread(handle, commentThreadHandle, threadId, resource, range, extensionId, isTemplate) {
452
- const provider = this._commentControllers.get(handle);
453
- if (!provider) {
454
- return undefined;
455
- }
456
- return provider.createCommentThread(extensionId.value, commentThreadHandle, threadId, resource, range, isTemplate);
457
- }
458
- $updateCommentThread(handle, commentThreadHandle, threadId, resource, changes) {
459
- const provider = this._commentControllers.get(handle);
460
- if (!provider) {
461
- return undefined;
462
- }
463
- return provider.updateCommentThread(commentThreadHandle, threadId, resource, changes);
464
- }
465
- $deleteCommentThread(handle, commentThreadHandle) {
466
- const provider = this._commentControllers.get(handle);
467
- if (!provider) {
468
- return;
469
- }
470
- return provider.deleteCommentThread(commentThreadHandle);
471
- }
472
- $updateCommentingRanges(handle, resourceHints) {
473
- const provider = this._commentControllers.get(handle);
474
- if (!provider) {
475
- return;
476
- }
477
- provider.updateCommentingRanges(resourceHints);
478
- }
479
- registerView(commentsViewAlreadyRegistered) {
480
- if (!commentsViewAlreadyRegistered) {
481
- const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
482
- id: COMMENTS_VIEW_ID,
483
- title: COMMENTS_VIEW_TITLE,
484
- ctorDescriptor: ( new SyncDescriptor(
485
- ViewPaneContainer,
486
- [COMMENTS_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]
487
- )),
488
- storageId: COMMENTS_VIEW_STORAGE_ID,
489
- hideIfEmpty: true,
490
- icon: commentsViewIcon,
491
- order: 10,
492
- }, 1 );
493
- ( Registry.as(Extensions.ViewsRegistry)).registerViews([{
494
- id: COMMENTS_VIEW_ID,
495
- name: COMMENTS_VIEW_TITLE,
496
- canToggleVisibility: false,
497
- ctorDescriptor: ( new SyncDescriptor(CommentsPanel)),
498
- canMoveView: true,
499
- containerIcon: commentsViewIcon,
500
- focusCommand: {
501
- id: 'workbench.action.focusCommentsPanel'
502
- }
503
- }], VIEW_CONTAINER);
504
- }
505
- }
506
- setComments() {
507
- [...( this._commentControllers.keys())].forEach(handle => {
508
- const threads = this._commentControllers.get(handle).getAllComments();
509
- if (threads.length) {
510
- const providerId = this.getHandler(handle);
511
- this._commentService.setWorkspaceComments(providerId, threads);
512
- }
513
- });
514
- }
515
- registerViewOpenedListener() {
516
- if (!this._openViewListener) {
517
- this._openViewListener = this._viewsService.onDidChangeViewVisibility(e => {
518
- if (e.id === COMMENTS_VIEW_ID && e.visible) {
519
- this.setComments();
520
- if (this._openViewListener) {
521
- this._openViewListener.dispose();
522
- this._openViewListener = null;
523
- }
524
- }
525
- });
526
- }
527
- }
528
- registerViewListeners(commentsPanelAlreadyConstructed) {
529
- if (!commentsPanelAlreadyConstructed) {
530
- this.registerViewOpenedListener();
531
- }
532
- this._register(this._viewDescriptorService.onDidChangeContainer(e => {
533
- if (e.views.find(view => view.id === COMMENTS_VIEW_ID)) {
534
- this.setComments();
535
- this.registerViewOpenedListener();
536
- }
537
- }));
538
- this._register(this._viewDescriptorService.onDidChangeContainerLocation(e => {
539
- const commentsContainer = this._viewDescriptorService.getViewContainerByViewId(COMMENTS_VIEW_ID);
540
- if (e.viewContainer.id === commentsContainer?.id) {
541
- this.setComments();
542
- this.registerViewOpenedListener();
543
- }
544
- }));
545
- }
546
- getHandler(handle) {
547
- if (!( this._handlers.has(handle))) {
548
- throw new Error('Unknown handler');
549
- }
550
- return this._handlers.get(handle);
551
- }
552
- };
553
- MainThreadComments = __decorate([
554
- extHostNamedCustomer(MainContext.MainThreadComments),
555
- ( __param(1, ICommentService)),
556
- ( __param(2, IViewsService)),
557
- ( __param(3, IViewDescriptorService))
558
- ], MainThreadComments);
559
-
560
- export { MainThreadCommentController, MainThreadCommentThread, MainThreadComments };
@@ -1,80 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { URI } from 'vscode/vscode/vs/base/common/uri';
3
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
- import { getScopes, Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
5
- import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
6
- import { MainContext, ExtHostContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
7
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
8
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
9
- import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment';
10
-
11
- let MainThreadConfiguration = class MainThreadConfiguration {
12
- constructor(extHostContext, _workspaceContextService, configurationService, _environmentService) {
13
- this._workspaceContextService = _workspaceContextService;
14
- this.configurationService = configurationService;
15
- this._environmentService = _environmentService;
16
- const proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostConfiguration));
17
- proxy.$initializeConfiguration(this._getConfigurationData());
18
- this._configurationListener = configurationService.onDidChangeConfiguration(e => {
19
- proxy.$acceptConfigurationChanged(this._getConfigurationData(), e.change);
20
- });
21
- }
22
- _getConfigurationData() {
23
- const configurationData = { ...(this.configurationService.getConfigurationData()), configurationScopes: [] };
24
- if (!this._environmentService.isBuilt || this._environmentService.isExtensionDevelopment) {
25
- configurationData.configurationScopes = getScopes();
26
- }
27
- return configurationData;
28
- }
29
- dispose() {
30
- this._configurationListener.dispose();
31
- }
32
- $updateConfigurationOption(target, key, value, overrides, scopeToLanguage) {
33
- overrides = { resource: overrides?.resource ? URI.revive(overrides.resource) : undefined, overrideIdentifier: overrides?.overrideIdentifier };
34
- return this.writeConfiguration(target, key, value, overrides, scopeToLanguage);
35
- }
36
- $removeConfigurationOption(target, key, overrides, scopeToLanguage) {
37
- overrides = { resource: overrides?.resource ? URI.revive(overrides.resource) : undefined, overrideIdentifier: overrides?.overrideIdentifier };
38
- return this.writeConfiguration(target, key, undefined, overrides, scopeToLanguage);
39
- }
40
- writeConfiguration(target, key, value, overrides, scopeToLanguage) {
41
- target = target !== null && target !== undefined ? target : this.deriveConfigurationTarget(key, overrides);
42
- const configurationValue = this.configurationService.inspect(key, overrides);
43
- switch (target) {
44
- case 8 :
45
- return this._updateValue(key, value, target, configurationValue?.memory?.override, overrides, scopeToLanguage);
46
- case 6 :
47
- return this._updateValue(key, value, target, configurationValue?.workspaceFolder?.override, overrides, scopeToLanguage);
48
- case 5 :
49
- return this._updateValue(key, value, target, configurationValue?.workspace?.override, overrides, scopeToLanguage);
50
- case 4 :
51
- return this._updateValue(key, value, target, configurationValue?.userRemote?.override, overrides, scopeToLanguage);
52
- default:
53
- return this._updateValue(key, value, target, configurationValue?.userLocal?.override, overrides, scopeToLanguage);
54
- }
55
- }
56
- _updateValue(key, value, configurationTarget, overriddenValue, overrides, scopeToLanguage) {
57
- overrides = scopeToLanguage === true ? overrides
58
- : scopeToLanguage === false ? { resource: overrides.resource }
59
- : overrides.overrideIdentifier && overriddenValue !== undefined ? overrides
60
- : { resource: overrides.resource };
61
- return this.configurationService.updateValue(key, value, overrides, configurationTarget, { donotNotifyError: true });
62
- }
63
- deriveConfigurationTarget(key, overrides) {
64
- if (overrides.resource && this._workspaceContextService.getWorkbenchState() === 3 ) {
65
- const configurationProperties = ( Registry.as(Extensions.Configuration)).getConfigurationProperties();
66
- if (configurationProperties[key] && ((configurationProperties[key].scope === 4 || configurationProperties[key].scope === 5) )) {
67
- return 6 ;
68
- }
69
- }
70
- return 5 ;
71
- }
72
- };
73
- MainThreadConfiguration = __decorate([
74
- extHostNamedCustomer(MainContext.MainThreadConfiguration),
75
- ( __param(1, IWorkspaceContextService)),
76
- ( __param(2, IConfigurationService)),
77
- ( __param(3, IEnvironmentService))
78
- ], MainThreadConfiguration);
79
-
80
- export { MainThreadConfiguration };
@@ -1,35 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
- import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
3
- import { MainContext } from 'vscode/vscode/vs/workbench/api/common/extHost.protocol';
4
- import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment';
5
- import { log } from '../../../base/common/console.js';
6
- import { logRemoteEntry, logRemoteEntryIfError } from '../../services/extensions/common/remoteConsoleUtil.js';
7
- import { parseExtensionDevOptions } from '../../services/extensions/common/extensionDevOptions.js';
8
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
9
-
10
- let MainThreadConsole = class MainThreadConsole {
11
- constructor(_extHostContext, _environmentService, _logService) {
12
- this._environmentService = _environmentService;
13
- this._logService = _logService;
14
- const devOpts = parseExtensionDevOptions(this._environmentService);
15
- this._isExtensionDevTestFromCli = devOpts.isExtensionDevTestFromCli;
16
- }
17
- dispose() {
18
- }
19
- $logExtensionHostMessage(entry) {
20
- if (this._isExtensionDevTestFromCli) {
21
- logRemoteEntry(this._logService, entry);
22
- }
23
- else {
24
- logRemoteEntryIfError(this._logService, entry, 'Extension Host');
25
- log(entry, 'Extension Host');
26
- }
27
- }
28
- };
29
- MainThreadConsole = __decorate([
30
- extHostNamedCustomer(MainContext.MainThreadConsole),
31
- ( __param(1, IEnvironmentService)),
32
- ( __param(2, ILogService))
33
- ], MainThreadConsole);
34
-
35
- export { MainThreadConsole };