@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,545 +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 isTemplate() {
97
- return this._isTemplate;
98
- }
99
- constructor(commentThreadHandle, controllerHandle, extensionId, threadId, resource, _range, _canReply, _isTemplate) {
100
- this.commentThreadHandle = commentThreadHandle;
101
- this.controllerHandle = controllerHandle;
102
- this.extensionId = extensionId;
103
- this.threadId = threadId;
104
- this.resource = resource;
105
- this._range = _range;
106
- this._canReply = _canReply;
107
- this._isTemplate = _isTemplate;
108
- this._onDidChangeInput = ( new Emitter());
109
- this._onDidChangeLabel = ( new Emitter());
110
- this.onDidChangeLabel = this._onDidChangeLabel.event;
111
- this._onDidChangeComments = ( new Emitter());
112
- this._onDidChangeCanReply = ( new Emitter());
113
- this._onDidChangeRange = ( new Emitter());
114
- this.onDidChangeRange = this._onDidChangeRange.event;
115
- this._onDidChangeCollapsibleState = ( new Emitter());
116
- this.onDidChangeCollapsibleState = this._onDidChangeCollapsibleState.event;
117
- this._onDidChangeInitialCollapsibleState = ( new Emitter());
118
- this.onDidChangeInitialCollapsibleState = this._onDidChangeInitialCollapsibleState.event;
119
- this._onDidChangeState = ( new Emitter());
120
- this.onDidChangeState = this._onDidChangeState.event;
121
- this._isDisposed = false;
122
- if (_isTemplate) {
123
- this.comments = [];
124
- }
125
- }
126
- batchUpdate(changes) {
127
- const modified = (value) => Object.prototype.hasOwnProperty.call(changes, value);
128
- if (modified('range')) {
129
- this._range = changes.range;
130
- }
131
- if (modified('label')) {
132
- this._label = changes.label;
133
- }
134
- if (modified('contextValue')) {
135
- this._contextValue = changes.contextValue === null ? undefined : changes.contextValue;
136
- }
137
- if (modified('comments')) {
138
- this._comments = changes.comments;
139
- }
140
- if (modified('collapseState')) {
141
- this.initialCollapsibleState = changes.collapseState;
142
- }
143
- if (modified('canReply')) {
144
- this.canReply = changes.canReply;
145
- }
146
- if (modified('state')) {
147
- this.state = changes.state;
148
- }
149
- if (modified('isTemplate')) {
150
- this._isTemplate = changes.isTemplate;
151
- }
152
- }
153
- dispose() {
154
- this._isDisposed = true;
155
- this._onDidChangeCollapsibleState.dispose();
156
- this._onDidChangeComments.dispose();
157
- this._onDidChangeInput.dispose();
158
- this._onDidChangeLabel.dispose();
159
- this._onDidChangeRange.dispose();
160
- this._onDidChangeState.dispose();
161
- }
162
- toJSON() {
163
- return {
164
- $mid: 7 ,
165
- commentControlHandle: this.controllerHandle,
166
- commentThreadHandle: this.commentThreadHandle,
167
- };
168
- }
169
- }
170
- class MainThreadCommentController {
171
- get handle() {
172
- return this._handle;
173
- }
174
- get id() {
175
- return this._id;
176
- }
177
- get contextValue() {
178
- return this._id;
179
- }
180
- get proxy() {
181
- return this._proxy;
182
- }
183
- get label() {
184
- return this._label;
185
- }
186
- get reactions() {
187
- return this._reactions;
188
- }
189
- set reactions(reactions) {
190
- this._reactions = reactions;
191
- }
192
- get options() {
193
- return this._features.options;
194
- }
195
- get features() {
196
- return this._features;
197
- }
198
- constructor(_proxy, _commentService, _handle, _uniqueId, _id, _label, _features) {
199
- this._proxy = _proxy;
200
- this._commentService = _commentService;
201
- this._handle = _handle;
202
- this._uniqueId = _uniqueId;
203
- this._id = _id;
204
- this._label = _label;
205
- this._features = _features;
206
- this._threads = ( new Map());
207
- }
208
- async setActiveCommentAndThread(commentInfo) {
209
- return this._proxy.$setActiveComment(this._handle, commentInfo ? { commentThreadHandle: commentInfo.thread.commentThreadHandle, uniqueIdInThread: commentInfo.comment?.uniqueIdInThread } : undefined);
210
- }
211
- updateFeatures(features) {
212
- this._features = features;
213
- }
214
- createCommentThread(extensionId, commentThreadHandle, threadId, resource, range, isTemplate) {
215
- const thread = ( new MainThreadCommentThread(commentThreadHandle, this.handle, extensionId, threadId, ( URI.revive(resource).toString()), range, true, isTemplate));
216
- this._threads.set(commentThreadHandle, thread);
217
- if (thread.isDocumentCommentThread()) {
218
- this._commentService.updateComments(this._uniqueId, {
219
- added: [thread],
220
- removed: [],
221
- changed: [],
222
- pending: []
223
- });
224
- }
225
- else {
226
- this._commentService.updateNotebookComments(this._uniqueId, {
227
- added: [thread],
228
- removed: [],
229
- changed: [],
230
- pending: []
231
- });
232
- }
233
- return thread;
234
- }
235
- updateCommentThread(commentThreadHandle, threadId, resource, changes) {
236
- const thread = this.getKnownThread(commentThreadHandle);
237
- thread.batchUpdate(changes);
238
- if (thread.isDocumentCommentThread()) {
239
- this._commentService.updateComments(this._uniqueId, {
240
- added: [],
241
- removed: [],
242
- changed: [thread],
243
- pending: []
244
- });
245
- }
246
- else {
247
- this._commentService.updateNotebookComments(this._uniqueId, {
248
- added: [],
249
- removed: [],
250
- changed: [thread],
251
- pending: []
252
- });
253
- }
254
- }
255
- deleteCommentThread(commentThreadHandle) {
256
- const thread = this.getKnownThread(commentThreadHandle);
257
- this._threads.delete(commentThreadHandle);
258
- thread.dispose();
259
- if (thread.isDocumentCommentThread()) {
260
- this._commentService.updateComments(this._uniqueId, {
261
- added: [],
262
- removed: [thread],
263
- changed: [],
264
- pending: []
265
- });
266
- }
267
- else {
268
- this._commentService.updateNotebookComments(this._uniqueId, {
269
- added: [],
270
- removed: [thread],
271
- changed: [],
272
- pending: []
273
- });
274
- }
275
- }
276
- deleteCommentThreadMain(commentThreadId) {
277
- this._threads.forEach(thread => {
278
- if (thread.threadId === commentThreadId) {
279
- this._proxy.$deleteCommentThread(this._handle, thread.commentThreadHandle);
280
- }
281
- });
282
- }
283
- updateInput(input) {
284
- const thread = this.activeEditingCommentThread;
285
- if (thread && thread.input) {
286
- const commentInput = thread.input;
287
- commentInput.value = input;
288
- thread.input = commentInput;
289
- }
290
- }
291
- updateCommentingRanges() {
292
- this._commentService.updateCommentingRanges(this._uniqueId);
293
- }
294
- getKnownThread(commentThreadHandle) {
295
- const thread = this._threads.get(commentThreadHandle);
296
- if (!thread) {
297
- throw new Error('unknown thread');
298
- }
299
- return thread;
300
- }
301
- async getDocumentComments(resource, token) {
302
- if (resource.scheme === Schemas.vscodeNotebookCell) {
303
- return {
304
- owner: this._uniqueId,
305
- label: this.label,
306
- threads: [],
307
- commentingRanges: {
308
- resource: resource,
309
- ranges: [],
310
- fileComments: false
311
- }
312
- };
313
- }
314
- const ret = [];
315
- for (const thread of [...( this._threads.keys())]) {
316
- const commentThread = this._threads.get(thread);
317
- if (commentThread.resource === ( resource.toString())) {
318
- ret.push(commentThread);
319
- }
320
- }
321
- const commentingRanges = await this._proxy.$provideCommentingRanges(this.handle, resource, token);
322
- return {
323
- owner: this._uniqueId,
324
- label: this.label,
325
- threads: ret,
326
- commentingRanges: {
327
- resource: resource,
328
- ranges: commentingRanges?.ranges || [],
329
- fileComments: commentingRanges?.fileComments
330
- }
331
- };
332
- }
333
- async getNotebookComments(resource, token) {
334
- if (resource.scheme !== Schemas.vscodeNotebookCell) {
335
- return {
336
- owner: this._uniqueId,
337
- label: this.label,
338
- threads: []
339
- };
340
- }
341
- const ret = [];
342
- for (const thread of [...( this._threads.keys())]) {
343
- const commentThread = this._threads.get(thread);
344
- if (commentThread.resource === ( resource.toString())) {
345
- ret.push(commentThread);
346
- }
347
- }
348
- return {
349
- owner: this._uniqueId,
350
- label: this.label,
351
- threads: ret
352
- };
353
- }
354
- async toggleReaction(uri, thread, comment, reaction, token) {
355
- return this._proxy.$toggleReaction(this._handle, thread.commentThreadHandle, uri, comment, reaction);
356
- }
357
- getAllComments() {
358
- const ret = [];
359
- for (const thread of [...( this._threads.keys())]) {
360
- ret.push(this._threads.get(thread));
361
- }
362
- return ret;
363
- }
364
- createCommentThreadTemplate(resource, range) {
365
- return this._proxy.$createCommentThreadTemplate(this.handle, resource, range);
366
- }
367
- async updateCommentThreadTemplate(threadHandle, range) {
368
- await this._proxy.$updateCommentThreadTemplate(this.handle, threadHandle, range);
369
- }
370
- toJSON() {
371
- return {
372
- $mid: 6 ,
373
- handle: this.handle
374
- };
375
- }
376
- }
377
- const commentsViewIcon = registerIcon('comments-view-icon', Codicon.commentDiscussion, ( localizeWithPath(
378
- 'vs/workbench/api/browser/mainThreadComments',
379
- 'commentsViewIcon',
380
- 'View icon of the comments view.'
381
- )));
382
- let MainThreadComments = class MainThreadComments extends Disposable {
383
- constructor(extHostContext, _commentService, _viewsService, _viewDescriptorService) {
384
- super();
385
- this._commentService = _commentService;
386
- this._viewsService = _viewsService;
387
- this._viewDescriptorService = _viewDescriptorService;
388
- this._handlers = ( new Map());
389
- this._commentControllers = ( new Map());
390
- this._activeEditingCommentThreadDisposables = this._register(( new DisposableStore()));
391
- this._openViewListener = null;
392
- this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostComments));
393
- this._commentService.unregisterCommentController();
394
- this._register(this._commentService.onDidChangeActiveEditingCommentThread(async (thread) => {
395
- const handle = thread.controllerHandle;
396
- const controller = this._commentControllers.get(handle);
397
- if (!controller) {
398
- return;
399
- }
400
- this._activeEditingCommentThreadDisposables.clear();
401
- this._activeEditingCommentThread = thread;
402
- controller.activeEditingCommentThread = this._activeEditingCommentThread;
403
- }));
404
- }
405
- $registerCommentController(handle, id, label, extensionId) {
406
- const providerId = `${id}-${extensionId}`;
407
- this._handlers.set(handle, providerId);
408
- const provider = ( new MainThreadCommentController(this._proxy, this._commentService, handle, providerId, id, label, {}));
409
- this._commentService.registerCommentController(providerId, provider);
410
- this._commentControllers.set(handle, provider);
411
- const commentsPanelAlreadyConstructed = !!this._viewDescriptorService.getViewDescriptorById(COMMENTS_VIEW_ID);
412
- if (!commentsPanelAlreadyConstructed) {
413
- this.registerView(commentsPanelAlreadyConstructed);
414
- }
415
- this.registerViewListeners(commentsPanelAlreadyConstructed);
416
- this._commentService.setWorkspaceComments(String(handle), []);
417
- }
418
- $unregisterCommentController(handle) {
419
- const providerId = this._handlers.get(handle);
420
- this._handlers.delete(handle);
421
- this._commentControllers.delete(handle);
422
- if (typeof providerId !== 'string') {
423
- return;
424
- }
425
- else {
426
- this._commentService.unregisterCommentController(providerId);
427
- }
428
- }
429
- $updateCommentControllerFeatures(handle, features) {
430
- const provider = this._commentControllers.get(handle);
431
- if (!provider) {
432
- return undefined;
433
- }
434
- provider.updateFeatures(features);
435
- }
436
- $createCommentThread(handle, commentThreadHandle, threadId, resource, range, extensionId, isTemplate) {
437
- const provider = this._commentControllers.get(handle);
438
- if (!provider) {
439
- return undefined;
440
- }
441
- return provider.createCommentThread(extensionId.value, commentThreadHandle, threadId, resource, range, isTemplate);
442
- }
443
- $updateCommentThread(handle, commentThreadHandle, threadId, resource, changes) {
444
- const provider = this._commentControllers.get(handle);
445
- if (!provider) {
446
- return undefined;
447
- }
448
- return provider.updateCommentThread(commentThreadHandle, threadId, resource, changes);
449
- }
450
- $deleteCommentThread(handle, commentThreadHandle) {
451
- const provider = this._commentControllers.get(handle);
452
- if (!provider) {
453
- return;
454
- }
455
- return provider.deleteCommentThread(commentThreadHandle);
456
- }
457
- $updateCommentingRanges(handle) {
458
- const provider = this._commentControllers.get(handle);
459
- if (!provider) {
460
- return;
461
- }
462
- provider.updateCommentingRanges();
463
- }
464
- registerView(commentsViewAlreadyRegistered) {
465
- if (!commentsViewAlreadyRegistered) {
466
- const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
467
- id: COMMENTS_VIEW_ID,
468
- title: COMMENTS_VIEW_TITLE,
469
- ctorDescriptor: ( new SyncDescriptor(
470
- ViewPaneContainer,
471
- [COMMENTS_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]
472
- )),
473
- storageId: COMMENTS_VIEW_STORAGE_ID,
474
- hideIfEmpty: true,
475
- icon: commentsViewIcon,
476
- order: 10,
477
- }, 1 );
478
- ( Registry.as(Extensions.ViewsRegistry)).registerViews([{
479
- id: COMMENTS_VIEW_ID,
480
- name: COMMENTS_VIEW_TITLE,
481
- canToggleVisibility: false,
482
- ctorDescriptor: ( new SyncDescriptor(CommentsPanel)),
483
- canMoveView: true,
484
- containerIcon: commentsViewIcon,
485
- focusCommand: {
486
- id: 'workbench.action.focusCommentsPanel'
487
- }
488
- }], VIEW_CONTAINER);
489
- }
490
- }
491
- setComments() {
492
- [...( this._commentControllers.keys())].forEach(handle => {
493
- const threads = this._commentControllers.get(handle).getAllComments();
494
- if (threads.length) {
495
- const providerId = this.getHandler(handle);
496
- this._commentService.setWorkspaceComments(providerId, threads);
497
- }
498
- });
499
- }
500
- registerViewOpenedListener() {
501
- if (!this._openViewListener) {
502
- this._openViewListener = this._viewsService.onDidChangeViewVisibility(e => {
503
- if (e.id === COMMENTS_VIEW_ID && e.visible) {
504
- this.setComments();
505
- if (this._openViewListener) {
506
- this._openViewListener.dispose();
507
- this._openViewListener = null;
508
- }
509
- }
510
- });
511
- }
512
- }
513
- registerViewListeners(commentsPanelAlreadyConstructed) {
514
- if (!commentsPanelAlreadyConstructed) {
515
- this.registerViewOpenedListener();
516
- }
517
- this._register(this._viewDescriptorService.onDidChangeContainer(e => {
518
- if (e.views.find(view => view.id === COMMENTS_VIEW_ID)) {
519
- this.setComments();
520
- this.registerViewOpenedListener();
521
- }
522
- }));
523
- this._register(this._viewDescriptorService.onDidChangeContainerLocation(e => {
524
- const commentsContainer = this._viewDescriptorService.getViewContainerByViewId(COMMENTS_VIEW_ID);
525
- if (e.viewContainer.id === commentsContainer?.id) {
526
- this.setComments();
527
- this.registerViewOpenedListener();
528
- }
529
- }));
530
- }
531
- getHandler(handle) {
532
- if (!( this._handlers.has(handle))) {
533
- throw new Error('Unknown handler');
534
- }
535
- return this._handlers.get(handle);
536
- }
537
- };
538
- MainThreadComments = __decorate([
539
- extHostNamedCustomer(MainContext.MainThreadComments),
540
- ( __param(1, ICommentService)),
541
- ( __param(2, IViewsService)),
542
- ( __param(3, IViewDescriptorService))
543
- ], MainThreadComments);
544
-
545
- 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 };